Powershell Essentials
[Link]
Powershell
Essentials Part-1
PowerShell is Microsoft new Command Line Interface for Windows
systems, it provides access to:
CMD- Command Prompt
PowerShell PowerShell Functions, Cmdlets (Powershell Commands)
Environment Access to the .Net Framework API
Access to Windows Management Instrumentation
Access to Windows Component Object Model (COM)
Powershell We use the Get-Help cmdlet displays information about Windows PowerShell concepts and
commands, including cmdlets, functions, CIM commands, workflows, providers, aliases
Essentials Part-2 and scripts.
–Detailed parameter is given it will show Parameter information and Examples.
–Full parameter is given it will show a more detailed list of info for Parameters.
Get-Help –Examples parameter is given only examples are shown.
PS C:\Users> get-help copy-item
PS C:\Users> get-help copy-item
PS C:\Users> get-help copy-item
PS C:\Users> get-help copy-item –detailed
Powershell
Essentials
Part-2
Get-Help
-detailed
PS C:\Users> get-help copy-item –full
Powershell
Essentials
Part-2
Get-Help
-full
PS C:\Users> get-help copy-item –example
Powershell
Essentials
Part-2
Get-Help
-example
Powershell PowerShell is an Object based Shell, this means that everything is
an object. Those who have programed in C#, VB, VB script or any
Essentials other Objects based language know very well the power of objects.
Part-3
Objects and Object is Data and it has 2 types of components.
the Pipeline Properties
Method
Selecting Objects
PS c:\ > Get-Service | Sort-Object
Powershell
Essentials
Part-4
Filtering and
Iterating over
Objects
Selecting Objects Filter- Select first 5 service
PS c:\ > Get-Service | Sort-Object | Select-Object -first 5
Powershell
Essentials
Part-4
Filtering and
Iterating over
Objects
Selecting Objects Foreach
PS c:\ > 1..4 | ForEach-Object { $Sum = 0 } { $Sum += $_ } { $Sum }
Powershell
Essentials
Part-4
Filtering and
Iterating over
Objects