Here are a few basic PowerShell cmdlets with examples:
- Get-Command: This cmdlet is used to retrieve a list of all available commands in the current session.Example:
Get-Command - Get-Help: This cmdlet is used to retrieve help information for a specific cmdlet or for PowerShell in general.Example:
Get-Help Get-Command - Get-ChildItem: This cmdlet is used to retrieve a list of items in a specified directory. It is similar to the "ls" command in Linux.Example:
Get-ChildItem C:\ - Get-Process: This cmdlet is used to retrieve a list of running processes on the computer.Example:
Get-Process - New-Item: This cmdlet is used to create a new item such as a file, directory, or symbolic link.Example:
New-Item -ItemType Directory -Path C:\TestDirectory - Remove-Item: This cmdlet is used to delete an item such as a file, directory, or symbolic link.Example:
Remove-Item C:\TestDirectory - Start-Process: This cmdlet is used to start a new process.Example:
Start-Process Notepad - Stop-Process: This cmdlet is used to stop a running process.Example:
Stop-Process -Name Notepad - Get-Service: This cmdlet is used to retrieve a list of services on the computer.Example:
Get-Service - Set-Service: This cmdlet is used to start, stop, or modify a service.Example:
Set-Service -Name W32Time -StartupType Manual
No comments:
Post a Comment