I am currently trying to run a script I wrote. It works great, but I need it to also search and remove from the hidden folders as well. It does not seem to have any effect on hidden folders... Here is my script.
Get-ChildItem C:\ -Include saplogon.ini -Recurse | foreach ($_) {Remove-Item $_.fullname}
$src_dir = "\\xxxxxxxxxx\xxxxxxxxxxxx\saplogon\saplogon.ini"
$dst_dir = "C:\Windows"
$file = Get-ChildItem $src_dir
Copy-Item $file -Destination $dst_dir
[System.Environment]::SetEnvironmentVariable('SAP_LOGON_INI', 'C:\Windows\saplogon.ini', 'Machine')