Posted onEdited onWord count in article: 2.5kReading time ≈4 mins.
Quick guide to common PowerShell commands for file management: compress, copy, move, extract, delete, create, and rename files and folders.
Recently, WebShell needed to support file management under PowerShell. To perform file-related operations, it’s necessary to understand the relevant commands. Here’s the summary.
w2: Cannot load file C:\Program Files\node js\w2.ps1 because running scripts is disabled on this system.
1 2 3 4 5 6
# Run PowerShell as administrator
# Check the current PowerShell script execution policy get-ExecutionPolicy # Set PowerShell's execution policy to RemoteSigned set-executionpolicy remotesigned
Path Contains []
If the path contains [], for example, executing Move-Item doesn’t throw an error but the execution is unsuccessful. The reason is that [] in the path is treated as regex, regardless of whether it’s a single or double quote. There are two solutions:
When executing Windows commands, you can choose between PowerShell and CMD. According to Microsoft’s recommendation, using PowerShell is advised, as CMD has entered the maintenance phase.