Hi Guys,
I’m writing a script to Reconfigure the Group Policies on a Couple of Computers in my Company
To do this I Delete the Old Ones and Update the new ones.
This works fine in the Script but once I Convert it to an Exe it stops working…
the Exe also works fine when I use my test Folder, but the windows folder doesn’t seem to work
This Doesn’t Work:
$a = Get-ChildItem $env:windir\System32\* -Hidden -filter "*GroupPolicy*"
Write-Host $a
if (!$null -eq $a)
{
Write-host "Found Something, Deleting"
} else
{
Write-host "Found Nothing"
}
Start-Sleep -Seconds 5
This Works
$a = Get-ChildItem c:\temp\* -Hidden -filter "*GroupPolicy*"
Write-Host $a
if (!$null -eq $a)
{
Write-host "Found Something, Deleting"
} else
{
Write-host "Found Nothing"
}
Start-Sleep -Seconds 10
Any Help would be Apreciated
Thx