Introduction
PowerShell was officially released by Microsoft in the fourth quarter of 2006, and its emergence marks a significant step in Microsoft's move to the server sector, bridging the gap between Uxin and Linux systems
PowerShell defines more than 200 cmdlet
First, the use of the cmdlet management system
(1), Management files, folders
For PowerShell, files and folders are referred to as items (item), and files and folders are distinguished by parameters
1, New-item: Create a file or folder
"New-item commonly used parameters"
-force: Allow cmdlet to create items to overwrite existing read-only entries
-itemtype: Specifies the type of new item, such as file, folder is directory
-name: Specifies the name of the new item to be created
-path: Specifies the path to the new item
-value: Specifies the value of the new item
"For example, create a new folder under C disk, named PowerShell"
New-item-path c:\-name Powershell-itemtype Directory
"For example, create a text file under the PowerShell folder, named Date.txt, content Hello"
New-item-path c:\Powershell-Nmae date.txt-value "Hello"-itemtype file
2, Get-childitem: Display folder Contents
"Get-childitem commonly used parameters"
-force: Get hidden files or system files
-include: Retrieves only the specified item, the value of this parameter qualifies the path parameter
-name: Retrieve only the names of the items in the location
-path: Specifies the path of one or more locations, the default location is the current directory ()
-recurse: Gets the items in the specified location and all its subkeys
"Example, retrieving all txt files in the current directory and its subdirectories"
Get-childitem. -include *.txt-recurse-force
"Example, retrieve the name of the file and folder for the current directory."
Get-childitem-name
3, Remove-item: Delete the specified item
"Remove-item commonly used parameters"
-exclude: Ignore specified item
-force: Delete hidden or system files
-include: Delete only specified items
-path: Specifies the path of the item to be deleted
-recurse: Deletes items in all subkeys of the specified location and these locations
"Example, delete all". "In the C:\PowerShell directory. The file "
Remove-itemc:\powershell\*.*
"Example, remove the syntax for all files with the. doc extension under the current directory."
remove-item*-include *.doc