Get-PC/Get-PC/Private/Invoke-Wake.ps1

11 lines
495 B
PowerShell

function Invoke-Wake($Computer) {
if (-not (Get-Module ConfigurationManager)) {
Write-Warning "ConfigurationManager module not available! Please install Configuration Manager Console to use this feature"
return
}
Write-Host "Attemping to wake up $Computer, check in a few minutes"
Push-Location
Set-Location "$(Get-PSDrive -PSProvider CMSite)`:"
Invoke-CMClientAction -DeviceName $Computer -ActionType ClientNotificationWakeUpClientNow
Pop-Location
}