Lab

Published on December 2016 | Categories: Documents | Downloads: 77 | Comments: 0 | Views: 636
of 3
Download PDF   Embed   Report

Comments

Content

Create a Transcript of Commands
 New-Item -Path C:\Users\pratyusha\Desktop -name
transcripts -type directory
 Start-Transcript C:\Users\pratyusha\Desktop\transcripts\$
((get-date).tostring("yyyyMMddHHmmss")).txt
 Get-Command
 Get-Service
 Get-process
 Get-help

 Get-command -commandtype Cmdlet





Get-command -commandtype alias

stop-transcript

notepad $transcript

Using the Most Common Commands
 get-help get-help -full

 get-help get-member



(get-help get-command) | get-member -membertype

noteproperty





(get-help get-command).syntax

[datetime] | get-member

[datetime] | get-member –static



[datetime]::utcNow

 Write-Output “Asset Information” |
out-file $home\documents\assetinfo.txt; get-date |
out-file $home\documents\assetinfo.txt -append;
$Env:COMPUTERNAME |
out-file $home\documents\assetinfo.txt -append; get-service
| out-file $home\documents\assetinfo.txt –append
 notepad "$home\documents\assetinfo.txt"

PowerShell Commands
PowerShell consists of four types of commands:
1. Cmdlets
2. Functions
3. Scripts
4. External commands
Cmdlets are commands ‘built-in’ to PowerShell. They are written in a .NET language
(C#, VB.NET, F#, etc.) and compiled into a dynamic link library (.DLL) file.
Commands have a verb-noun naming convention, where the verb describes the
action to take on the noun. Nouns are always named in a singular way (Process
rather than Processes). It is also worth knowing that PowerShell is not case
sensitive.

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close