В настоящее время я пытаюсь запустить сценарий, который я написал. Он отлично работает, но мне нужно его также для поиска и удаления из скрытых папок. Кажется, это не влияет на скрытые папки ... Вот мой сценарий.Сценарий PowerShell для удаления файла из скрытых папок
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')
'get-childitem -force' при условии, что у вас есть разрешения – Matt