]> apps.delaporte.us Git - dotfiles.git/blobdiff - psmodules/file_management.psm1
Add requirements file
[dotfiles.git] / psmodules / file_management.psm1
index 3622885c75e91c9e717577a2b90f4a7adfb28135..0db210109ac3ca6fa2d4cab9b16dbf177d71ae0d 100644 (file)
@@ -46,7 +46,7 @@ Export-ModuleMember -Function Show-LargeFiles
 
 # 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{
@@ -59,4 +59,15 @@ function Invoke-StayAwake() {
        # 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