powershell_file_operations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
powershell_file_operations [2021/10/29 23:08] mguptonpowershell_file_operations [2022/02/23 17:45] (current) mgupton
Line 13: Line 13:
 } }
 </code> </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.1635548918.txt.gz
  • Last modified: 2021/10/29 23:08
  • by mgupton