]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - psmodules/file_management.psm1
Typo fix
[dotfiles.git] / psmodules / file_management.psm1
index bbb6fa12bd2a3eaf2accd2ffc5f79965711b731d..0db210109ac3ca6fa2d4cab9b16dbf177d71ae0d 100644 (file)
@@ -6,9 +6,10 @@ Find 10 largest files on the C drive.
 #>
 function Show-LargeFiles() {
        param(
 #>
 function Show-LargeFiles() {
        param(
-               [int]$Max=10
+               [int]$Max=10,
+               [string]$path="C:\Users"
        )
        )
-       Get-ChildItem c:\ -r| sort -descending -property length | select -first $Max name, Length, FullName
+       Get-ChildItem $path -r | sort -descending -property length | select -first $Max name, Length, FullName
 }
 
 <#
 }
 
 <#
@@ -45,7 +46,7 @@ Export-ModuleMember -Function Show-LargeFiles
 
 # Stay awake to allow large transfers to complete
 #    without permanently giving up battery saving features
 
 # Stay awake to allow large transfers to complete
 #    without permanently giving up battery saving features
-function Invoke-StayAwake() {
+function Invoke-StayAwakeWindows() {
        param($minutes=90)
        $wsh = New-Object -ComObject WScript.Shell
        do{
        param($minutes=90)
        $wsh = New-Object -ComObject WScript.Shell
        do{
@@ -58,4 +59,15 @@ function Invoke-StayAwake() {
        # Thank you to http://www.zhornsoftware.co.uk/caffeine/
 }
 
        # Thank you to http://www.zhornsoftware.co.uk/caffeine/
 }
 
-Export-ModuleMember -Function Invoke-StayAwake
\ No newline at end of file
+Export-ModuleMember -Function Invoke-StayAwakeWindows
+
+function Invoke-StayAwake() {
+       param($minutes=90)
+       do{
+               "Staying awake for $minutes minutes"
+               systemd-inhibit sleep 60
+               $minutes-=1;
+       }until($minutes -lt 0)
+}
+
+Export-ModuleMember -Function Invoke-StayAwake