59 lines
1.5 KiB
PowerShell
59 lines
1.5 KiB
PowerShell
<#
|
|
.DESCRIPTION
|
|
Sets HP WOL configuration
|
|
|
|
.NOTES
|
|
|
|
Author: Daniel Classon
|
|
Adpater par: Aurelien HAMEZ
|
|
Version: 1.0
|
|
Date: 2021-06-22
|
|
|
|
|
|
.EXAMPLE
|
|
.\Set-HPConfiguration.ps1 -Enable TPM
|
|
|
|
#>
|
|
|
|
Param(
|
|
[Parameter(Mandatory=$False)]
|
|
[string]$Enable,
|
|
[Parameter(Mandatory=$False)]
|
|
[string]$Disable,
|
|
[Parameter(Mandatory=$False)]
|
|
[string]$Configure,
|
|
[Parameter(Mandatory=$False)]
|
|
[string]$New_PasswordFile = "new_password.bin"
|
|
)
|
|
|
|
Begin {
|
|
|
|
switch ($Configure)
|
|
{
|
|
'VideoMemory' {$ConfigFile="$PSScriptRoot\Configure_VideoMemory.txt"}
|
|
'OptionWOL' {$ConfigFile="$PSScriptRoot\Configure_OptionWOL.txt"}
|
|
Default {}
|
|
}
|
|
|
|
switch ($Enable)
|
|
{
|
|
'SecureBoot' {$ConfigFile="$PSScriptRoot\Enable_SecureBoot.txt"}
|
|
'TPM' {$ConfigFile="$PSScriptRoot\Enable_TPM.txt"}
|
|
'Virtualization' {$ConfigFile="$PSScriptRoot\Enable_Virtualization.txt"}
|
|
'WLANSwitching' {$ConfigFile="$PSScriptRoot\Enable_WLANSwitching.txt"}
|
|
'EnableWOL' {$ConfigFile="$PSScriptRoot\Enable_OptionWOL.txt"}
|
|
Default {}
|
|
}
|
|
switch ($Disable)
|
|
{
|
|
'Virtualization' {$ConfigFile="$PSScriptRootDisable_Virtualization.txt"}
|
|
'DisableWOL' {$ConfigFile="$PSScriptRoot\Disable_OptionWOL.txt"}
|
|
Default {}
|
|
}
|
|
}
|
|
Process {
|
|
#On configure le mot de passe si vide
|
|
$process = Start-Process -FilePath "$PSScriptRoot\BiosConfigUtility64.exe" -ArgumentList "`"/cpwdfile:$PSScriptRoot\$New_PasswordFile`"", "`"/set:$ConfigFile`"", "/log" -Wait -PassThru
|
|
}
|
|
End {
|
|
} |