Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PowerShell: Quick Question About Syntax

Posted on 2013-01-10
3
Medium Priority
?
378 Views
Last Modified: 2013-01-10
I've found a quick script to use as a foundation for a process I want to automate.  In the first line of this script there is a parameter in which I'm having difficulty understanding, specifically the *0* parameter.  The line reads:

Add-Pssnapin *0*

I understand that the script calls PowerShell, but I don't understand the need for *0*.  I'm assuming that it's a wildcard to call any version of PowerShell available, but I don't want to make an uneducated assumption.
0
Comment
Question by:DrivelFree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 30

Expert Comment

by:Brad Howe
ID: 38762639
Can you post the entire script?

*0* looks like an argument being passed into the script or a variable within the script.

Add-PSsnapin is relative straight forward.

Add-PSSnapin [-Name] <String[]> [-PassThru] [ <CommonParameters>]
http://technet.microsoft.com/en-us/library/hh849705.aspx

Cheers,
Hades666
0
 
LVL 15

Accepted Solution

by:
Rajkumar-MCITP earned 2000 total points
ID: 38762655
Syntax of the Add-PSsnapin will be

Add-PSSnapin [-Name] <String[]> [-PassThru] [ <CommonParameters>]

where the -Name feild is a required one and -Passthru is optional

and the -Name feild will accept wild card charectors

for your question, Add-Pssnapin *0* - I believe it is o and not 0 (zero) and it refers to load any version of powershell
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38762672
It simply says add Pssnapin (PowerShell snap-ins) which contains 0 in name.. For example..
Add-Pssnapin *Power* will load all Pssnapin's which has word power in it's name..

You can use Get-Pssnapin to find available Pssnapin's.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question