]> apps.delaporte.us Git - dotfiles.git/commitdiff
Update stay awake as function
authorEdTheDev <edward@delaporte.us>
Sat, 11 Nov 2023 22:49:00 +0000 (16:49 -0600)
committerEdTheDev <edward@delaporte.us>
Sat, 11 Nov 2023 22:49:00 +0000 (16:49 -0600)
psmodules/file_management.psm1 [moved from psmodules/drivespace.psm1 with 68% similarity]
psmodules/sprint.psm1 [deleted file]
psmodules/stay_awake.psm1 [moved from win/stay_awake.ps1 with 100% similarity]

similarity index 68%
rename from psmodules/drivespace.psm1
rename to psmodules/file_management.psm1
index b946f86d9f71531db914e71ae828d917e07aef4d..bbb6fa12bd2a3eaf2accd2ffc5f79965711b731d 100644 (file)
@@ -42,3 +42,20 @@ Get-Job -Name "FileCollection" | Remove-Job
 
 Export-ModuleMember -Function Show-DriveSpace 
 Export-ModuleMember -Function Show-LargeFiles
 
 Export-ModuleMember -Function Show-DriveSpace 
 Export-ModuleMember -Function Show-LargeFiles
+
+# Stay awake to allow large transfers to complete
+#    without permanently giving up battery saving features
+function Invoke-StayAwake() {
+       param($minutes=90)
+       $wsh = New-Object -ComObject WScript.Shell
+       do{
+               "Staying awake for $minutes minutes"
+       $minutes-=1;
+       # Send Shift+F15
+       $wsh.SendKeys('+{F15}')
+       Start-Sleep -seconds 59
+       }until($minutes -lt 0)
+       # Thank you to http://www.zhornsoftware.co.uk/caffeine/
+}
+
+Export-ModuleMember -Function Invoke-StayAwake
\ No newline at end of file
diff --git a/psmodules/sprint.psm1 b/psmodules/sprint.psm1
deleted file mode 100644 (file)
index 74040fb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-function Show-SprintCharts(){
-    $closed = Get-GHClosed
-    $closed_count = ($closed | Measure-Object).Count
-       Add-Content -Path ~/.chart_closed -Value "|$closed_count"
-       $env:closed =  Get-Content -Path ~/.chart_closed
-
-    $orphans = Get-GHNoMilestone -repository SecOps-Tools
-    $orphans_count = ($orphans | Measure-Object -Property updated_at -Min -Max).Count
-       Add-Content -Path ~/.chart_orphans -Value "|$orphans_count"
-       $env:orphans =  Get-Content -Path ~/.chart_orphans
-
-    $unsized = Get-GHUnsized
-    $unsized_count = ($unsized | Measure-Object).Count
-       Add-Content -Path ~/.chart_unsized -Value "|$unsized_count"
-       $env:unsized =  Get-Content -Path ~/.chart_unsized
-
-    Write-Host "## Closed Issues this Sprint: $closed_count"
-    Write-Host "'''sh"
-    chart -var "closed"
-    Write-Host "''' "
-    Write-Host "## Count of Unsized Issues: $unsized_count"
-    Write-Host "'''sh"
-    chart -var "unsized"
-    Write-Host "''' "
-    Write-Host "## Count of Issues with no milestone: $orphans_count"
-    Write-Host "'''sh"
-    chart -var "orphans"
-    Write-Host "''' "
-
-}
-
-Export-ModuleMember -Function Show-SprintCharts
\ No newline at end of file
similarity index 100%
rename from win/stay_awake.ps1
rename to psmodules/stay_awake.psm1