Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- W2d.powershell cmdlet.research
- Exercise:
- The best way to learn PowerShell is by trying commands and see what the results are. Please research the use and function of the following commands. Please use these commands in context to learn PowerShell, and provide an example.
- Group 1
- Command
- Function
- Get-Help
- This shows the help menu. You can use the help function to find out similar commands.
- Get-Help command
- Get-Command
- Shows a list of all the command you can do.
- Get-Command (any command)
- Get-ChildItem
- Show the child directory
- Shows all the items/folders and stuff into the directory
- Set-Location
- Is just like CD
- NAME
- Set-Location
- SYNTAX
- Set-Location [[-Path] <string>] [-PassThru] [-UseTransaction] [<CommonParameters>]
- Clear-Host
- This clears the screen
- Clear-Host
- Show-Command
- Gives a pop up of all the command and have a search bar
- Show-command
- Get-EventLog
- Allows you to look for a nd open an event log
- Get-EventLog logname
- Get-Service
- Shows a list of all running and stopped services on the system
- Get-Service
- Get-VM
- This allows you to open a VM
- Get-Vm Windows 10
- New-VM
- Allows you to create a new VM
- New-VM Windows 10
- New-Item
- Allows you to create any file type in the directory
- New-Item [-Path] <string[]> [-ItemType <string>] [-Value <Object>] [-Force] [-Credential <pscredential>] [-WhatIf]
- [-Confirm] [-UseTransaction] [<CommonParameters>]
- Remove-Item
- Deletes the selected item
- Remove-Item awindowsfile
- Move-Item
- Moves the item to somewhere else
- Move-Item awindowsfile Desktop
- Copy-Item
- Copy and paste the item to somewhere else
- Copy-Item awindowsfile Desktop
- Invoke-Item
- Basically a double click on a file
- C:\> Invoke-Item "C:\folder\awindowsfile.doc"
- Rename-Item
- Renames a file
- Rename-Item awindowsfile testfile
- Get-Content
- This reads the contents of a file a display it.
- C:\> Get-Content -Path "C:\Chapters\Chapter1.txt"
- Set-Content
- This writes or replaces the content in the file
- C:\> Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World"
- Clear-Content
- Deletes the contents of an item, but does not delete the item.
- Clear-Content
- Add-Content
- Add contents to a file
- Add-Content c:\scripts\test.txt "The End"
- Get-Service
- This gets a list of all running and stopped services on the system
- Get-Service
- Start-service
- This starts up a services and runs its program
- Start-Service wallpaper engine
- Stop-Service
- This stops a running service
- Stop-Service wallpaper engine
- Suspend-Service
- This pause a service but doesn't shut it up. Can be easily resumed
- Suspend-Service wallpaper engine
- Resume-Service
- This resumes a stopped service
- Resume-Service ose64
- Restart-Service
- This restarts a service
- Restart-Service Hyper-v
- New-Service
- Creates a new entry for a Windows service in the registry and in the service database.
- New-Service
- [-Name] <String>
- [-BinaryPathName] <String>
- [-DisplayName <String>]
- [-Description <String>]
- [-StartupType <ServiceStartMode>]
- [-Credential <PSCredential>]
- [-DependsOn <String[]>]
- [-WhatIf]
- [-Confirm]
- [<CommonParameters>]
- Get-Process
- This gets a list of all active processes running
- Gett-Process
- Start-Process
- Starts a process
- Start-Process -processname notepad
- Stop-Process
- Ends a process
- Stop-Process -processname notepad
- Wait-Process
- Waits for one or more running processes to be stopped before accepting input.
- Wait-Process
- [-Name] <String[]>
- [[-Timeout] <Int32>]
- [<CommonParameters>]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement