0 0

Enable WakeOnLAN on Dell

Install-PackageProvider -Name NuGet -Force -Confirm:$false
Install-Module -Name DellBIOSProvider -Force -SkipPublisherCheck
Import-Module -Name DellBIOSProvider
#Set Wake-On-LAN to LanOnly
$BIOSItem = "PowerManagement\WakeOnLan"
$NewValue = "LanWlan"
#Check if LanWlan is available
If ($NewValue -notin ("DellSmBios:\" + $BIOSItem).PossibleValues) {
	$NewValue = "LanOnly"
}
If (Get-Item -Path ("DellSmBios:\" + $BIOSItem) -ErrorAction SilentlyContinue) {
	Write-Host ("BIOS" + [char]32 + $BIOSItem.split('\')[1] + ":" + [char]32) -NoNewline
	If ((Get-Item -Path ("DellSmBios:\" + $BIOSItem)).CurrentValue -ne $NewValue) {
		If ($BIOSPassword) {
			Set-Item -Path ("DellSmBios:\" + $BIOSItem) -Value $NewValue -Force -Password $BIOSPassword
		} else {
			Set-Item -Path ("DellSmBios:\" + $BIOSItem) -Value $NewValue -Force
		}
		If ((Get-Item -Path ("DellSmBios:\" + $BIOSItem)).CurrentValue -eq $NewValue) {
			Write-Host $NewValue -ForegroundColor Yellow
		}
		else {
			Write-Host (Get-Item -Path ("DellSmBios:\" + $BIOSItem)).CurrentValue -ForegroundColor Red
		}
	}
	else {
		Write-Host $NewValue -ForegroundColor Yellow
	}
}