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

x
?
Solved

add parameter on powershell script

Posted on 2012-03-12
1
Medium Priority
?
583 Views
Last Modified: 2012-03-12
Hello,

I try to add parameters on powershell script but it doesn't work.
The code is :
[reflection.assembly]::loadwithpartialname('system.windows.forms') | Out-Null; 
		[system.Windows.Forms.MessageBox]::show("Installation MS Analysis Services Failover Cluster")
param 
( 
	[string]$A = "InstallCluster", 
	[string]$I = "MAS", 
	[string]$V = "MAS", 
	[string]$Help = "Help",
	[switch]$verbose,
	[switch]$debug
)
if ($A -eq "") 
	{
		Write-Debug "Setting the action parameter to InstallCluster, AddNode, Uninstall" 
		
	} 

Open in new window


How can I resolve this problem?

Thanks

Regards
bibi
0
Comment
Question by:bibi92
[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
1 Comment
 
LVL 11

Accepted Solution

by:
Joe Klimis earned 2000 total points
ID: 37710697
Hi

The Param statment needs to be the 1st line in t

Open in new window

he script
i have changed it round and this now works for me .

Give it a  try and let me know.

param 
( 
	[string]$A = "InstallCluster", 
	[string]$I = "MAS", 
	[string]$V = "MAS", 
	[string]$Help = "Help",
	[switch]$verbose,
	[switch]$debug
)
[reflection.assembly]::loadwithpartialname('system.windows.forms') | Out-Null; 
		[system.Windows.Forms.MessageBox]::show("Installation MS Analysis Services Failover Cluster")

if ($A -eq "") 
	{
		Write-Debug "Setting the action parameter to InstallCluster, AddNode, Uninstall" 
		
	} 
        

Open in new window

0

Featured Post

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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