Cmdlet
|
Usage
|
Example
|
Get-ChildItem | Returns items in the specified folder | Get-ChildItem $folder -include *.cs -force -recurse |
Copy-Item (cpi) | Copy files or folders | Copy-Item $folder/$file -force -recurse cpi $folder/$file -force -recurse |
Remove-Item (ri) | Delete files or folders | Remove-Item $folder -force -recurse ri $file -force |
New-Item (ni) | Create new files or folders | New-Item $folder -type directory ni $file -type file -force |
Invoke-Item (ii) | Run executable file or open a file. Alternatively prefix the script with an ampersand (&) and make sure to enclose parameters with spaces in double quotes | Invoke-Item $script ii $script & $script "parameter1" "parameter2" |
Get-Location (gl) | Returns the current folder | $currentDirectory = Get-Location |
Set-Location (sl) | Change the current folder | Set-Location $newFolder sl $newFolder |
*joychua97
No comments:
Post a Comment