Windows Classroom Series – 29/Sept/2020

Powershell Aliases

  • Navigate to the Powershell & Execute the following commands
Get-Alias
Get-Alias dir

  • To Create a New Alias
Get-Command -Noun Alias
Get-Help New-Alias -Online
Get-Help about_Aliases

Understanding Parameters in Powershell?

  • If we look into help of some cmd-lets, as shown below how to read them
  • Parameter Types:
    • Optional Parameters:
      • In help docs they are surronded by square brackets
      Get-Process
      Get-Process -Name notepad
      
    • Optional Positional Parameters:
      • Positional Parameters can be passed without referring the parameter with name
      • Eg:
      Get-Process -Name 'notepad'
      Get-Process 'notepad'
      
      • Positional parameters can be optional. Which is represented in red color below
    • Mandatory Parameters:
      • This are the Parameters which you need to suppy
      • Execute Get-Help Copy-Item
    • Switch Parameter: The presence of switch parameter makes a difference
      • Example: Get-ChildItem, Get-ChildItem -Recurse
    • Common Parameters:
      • Example
      • Execute the command Get-Help about_CommonParameters
    • Parameter Values:
      • We see the parameters such as
      <string> => string
      <string []> => a list of strings
      

Next Topics

  • Confirm Paramters
  • Providers
  • Splatting
  • Modules & Snap-ins
  • Powershell Gallery

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Widget Powered by Acurax Web Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%