1 $wake = gwmi -namespace root/hp/instrumentedbIOS -class HP_BIOSSetting | Where-Object { $_.name -like '*Active*Management*' }
2 Write-Log -Message 'Read string' -Path .\Script.log -Level Info
3 Write-Log -Message $wake.Name -Path .\Script.log -Level Info
4
5 #Read TXT or INI
6
7 $filesTXT = Get-ChildItem -Path ..\*.txt -Recurse
8
9 foreach ($file in $filesTXT) {
10 Write-Log -Message $file.FullName -Path .\Script.log -Level Info
11 (Get-Content $file.FullName).replace('Active Management (AMT)', $wake.Name) | Set-Content $file.FullName
12 }
13 $filesINI = Get-ChildItem -Path ..\*.ini -Recurse
14
15 foreach ($file in $filesINI) {
16 Write-Log -Message $file.FullName -Path .\Script.log -Level Info
17 (Get-Content $file.FullName).replace('Active Management (AMT)', $wake.Name) | Set-Content $file.FullName
18 }