Solved

PowerShell: Quick Question About Syntax

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

689 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