Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Powershell File Operations ====== === Example of searching for files with cmd === #search <code> cmd /r dir /s /b c:\tmp\*.xml </code> <code powershell> get-childitem .\ -recurse | where {$_.extension -eq ".txt"} | foreach-object { Write-Host $_.FullName } </code> === Delete file if exists and recreate it === <code powershell> $filename = "c:\tmp\webapp1.zip"; If (Test-Path $filename) {Remove-Item $filename}; Compress-Archive -Path .\* -DestinationPath c:\tmp\webapp1.zip </code> powershell_file_operations.txt Last modified: 2022/02/23 17:45by mgupton