Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d93a43d260 | ||
|
|
618cf7a7b7 | ||
|
|
a3278beb71 |
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user