Solved

PowerShell: Quick Question About Syntax

Posted on 2013-01-10
3
365 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
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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now