37 lines
961 B
PowerShell
37 lines
961 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Déactivation du démarrage rapide
|
|
|
|
.DESCRIPTION
|
|
0 pour désactiver
|
|
1 pour activer
|
|
|
|
.PARAMETER
|
|
|
|
|
|
.EXAMPLE
|
|
|
|
|
|
.NOTES
|
|
Auteurs :
|
|
Aurélien Hamez - Service Exploitation - Secteur Roubaix-Tourcoing
|
|
Région Hauts de France
|
|
#>
|
|
|
|
$PathKey = "HKLM:\SYSTEM\CurrentControlSet\Services\NDIS\Parameters\"
|
|
$Key = "AllowWakeFromS5"
|
|
|
|
$Value = Get-ItemProperty $PathKey -Name $Key -ErrorAction SilentlyContinue
|
|
if ($Value){
|
|
$ValueKey = Get-ItemPropertyValue -Path $PathKey -Name $Key
|
|
If ($ValueKey -ne 1)
|
|
{
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NDIS\Parameters" -Name AllowWakeFromS5 -Type DWORD -Value 00000001
|
|
}
|
|
}
|
|
else{
|
|
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NDIS\Parameters\" -Name AllowWakeFromS5 -Type DWORD -Value 00000001
|
|
}
|
|
|
|
|