$file = Get-ChildItem -Include unattend.xml -Recurse
Foreach ($str in $file)
{
$cont = Get-Content $str
$cont | Foreach {$_ -replace "999", "2"} | Set-Content $str
$cont = Get-Content $str
$cont | Foreach {$_ -replace "P@ssw0rd ", "newP@ssw0rd "} | Set-Content $str
$exists = Select-String -Path $str -pattern "CopyProfile"
If ($exists -ne $null)
{
}
else
{
$cont = Get-Content $str
$cont | Foreach {$_ -replace "
", "`r`ntrue "} | Set-Content $str
}
}
Foreach ($str in $file)
{
$cont = Get-Content $str
$cont | Foreach {$_ -replace "999", "2"} | Set-Content $str
$cont = Get-Content $str
$cont | Foreach {$_ -replace "
$exists = Select-String -Path $str -pattern "CopyProfile"
If ($exists -ne $null)
{
}
else
{
$cont = Get-Content $str
$cont | Foreach {$_ -replace "
", "`r`n
}
}
Komentarze
Prześlij komentarz