Compare commits

...
3 Commits
Author SHA1 Message Date
dyoder d93a43d260 initial commit 2023-09-15 16:48:07 -04:00
dyoder 618cf7a7b7 source tools directly 2023-09-15 16:47:50 -04:00
dyoder a3278beb71 minor changes - may be used more later 2023-09-15 16:46:10 -04:00
3 changed files with 18 additions and 2 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1')))
# When deleting temp files en masse, only delete files/folders older than the number of days specified here
$OlderThan = 7
$TimeDelta = New-TimeSpan -Days $OlderThan
+11
View File
@@ -0,0 +1,11 @@
# Disable unattended sleep timeout (if computer was woken up by an unattended process, this timer kicks in)
# The default value for this setting is 120 (2 minutes)
# Aliases:
# SUB_SLEEP = 238c9fa8-0aad-41ed-83f4-97be242c8f20
# UNATTENDSLEEP = 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0
$UnattendedSleepTimeout = 0
Try {
Start-Process "powercfg.exe" -ArgumentList "/setacvalueindex SCHEME_CURRENT SUB_SLEEP UNATTENDSLEEP ${UnattendedSleepTimeout}" -Wait
Start-Process "powercfg.exe" -ArgumentList "/setdcvalueindex SCHEME_CURRENT SUB_SLEEP UNATTENDSLEEP ${UnattendedSleepTimeout}" -Wait
}
Catch { Write-Error $_.Exception.Message }
+5 -1
View File
@@ -9,6 +9,9 @@
[string]$Global:LogsDirectory
[string]$Global:LogFile
# Define the root path for the MSP in the Windows Registry
[string]$Global:MSPRegistryRoot = "HKEY_LOCAL_MACHINE\SOFTWARE\${MSPName}"
## Setup the MSP management directories
Function Setup-MSPDirectories {
If ( Test-Path ${Env:ProgramData} ) { $Global:RootDirectory = "${Env:ProgramData}\${MSPName}" } Else { $Global:RootDirectory = "${Env:SystemDrive}\${MSPName}" }
@@ -892,4 +895,5 @@ Function Restart-EndpointOnUptime ([timespan]$MaxUptime) {
}
Setup-MSPDirectories
Setup-LogFile
Setup-LogFile
SetToolsScriptLocation