Resources For IT Professionals
Search TechNet Blogs
Search Results
  • Blog Post: Best Practice for Using Aliases in PowerShell Scripts

    ...command; but then, there is no default alias for the Stop-Computer cmdlet. There is nothing to keep one from creating an alias for it. However, I am considering really...function Stop-MyComputers   Set-Alias -Name sac -Value Stop-MyComputers -Description...
    in Blog -
  • Blog Post: Hey, Scripting Guy! How Can I Add a Function to a Profile in Windows PowerShell?

    ...get-profile The other thing I like to do is to create an alias for a function that I add to my Windows PowerShell...on a regular basis, it makes sense to create a alias for it. Before creating a new alias, it is a best practice to see if there is a suitable...
    in Blog -
  • Blog Post: Hey, Scripting Guy! What's the Deal with the Dash in Cmdlet Names?

    ...the scripter@microsoft.com e-mail alias and get ready for the approaching holiday...gcm -CommandType cmdlet | % { Set-Alias ( $_.name -replace...schemas-microsoft-com:office:office" /> GCM is the alias for the Windows PowerShell Get-Command...
    in Blog -
  • Blog Post: Hey, Scripting Guy! Tell Me About Aliases in Windows PowerShell

    ...Wilson. The book is available for pre-order . Verifying the existence of an alias Before creating a new alias, it is a best practice to see if there is a suitable alias already created for the cmdlet in question. By default, Windows PowerShell...
    in Blog -
  • Blog Post: When You Should Use PowerShell Aliases

    ...the Get-Process cmdlet, use the Get-Alias cmdlet. This technique is shown here...this command). PS C:\> Get-Alias -Definition Get-Process   CommandType...nbsp;  ---------- Alias     ...
    in Blog -
  • Blog Post: Hey, Scripting Guy! Weekend Scripter: Conversion Module, Part 6

    ...see which ones are available, I used the Get-Alias cmdlet. Because all of the functions begin with convertTo , I decided the first two letters of the alias should be ct . Using the alias for Get-Alias ( gal ) and a wildcard character...
    in Blog -
  • Blog Post: Hey, Scripting Guy! How Can I Create Managed Service Accounts?

    ...shortening the length of the command is to see if there is an alias for the New-ADServiceAccount . Using the Get-Alias cmdlet, you get the following results: PS C:\> Get-Alias -Definition New-ADServiceAccount Get-Alias : This command...
    in Blog -
  • Blog Post: Learn How IT Pros Can Use the PowerShell AST

    ...nbsp;     if ($Alias = Get-Alias | where { $_.Name -eq $Content }) {  ...nbsp;      Alias = $Alias.Name     ...
    in Blog -
  • Blog Post: Don’t Write PowerShell Scripts

    ...txt This command works because gwmi is an alias for the Get-WmiObject cmdlet. I need...Get-Content cmdlet. I can use cn as an alias for the longer C omputerName parameter...cmdlet as shown here. PS C:\> Get-Alias -Definition get-content   CommandType...
    in Blog -
  • Blog Post: Top Ten Favorite PowerShell Tricks: Part 2

    ...the Get-Process cmdlet, there is an alias, gps . But I can also type Get-p and...the Windows PowerShell cmdlet name (or alias) is in place, I type a dash (-) and...following command. PS C:\> Get-Alias ? Here is the command output: ...
    in Blog -
Page 1 of 31 (306 items) 12345»
Search Tips
  • The more specific you can be with your keywords, the better the search results.
  • If you're looking for a specific phrase then use quotes. For example: "code of conduct" or "how to".
  • Avoid using words such as 'the', 'of', 'a' - they exist in every article and are ignored in the search except when used as part of a phrase.