VMware Cloud Community
max2479
Enthusiast
Enthusiast
Jump to solution

Report into MS Word script problem

trying to use this script http://communities.vmware.com/docs/DOC-7070

param( string $VIServer )

if ($VIServer -eq "powershell.exe Report.ps1 vc1"){

Write-Host

Write-Host "Please specify a VI Server name eg...."

Write-Host " powershell.exe Report.ps1 MYVISERVER"

Write-Host

Write-Host

exit

-


vc1 is my virtual center

-


debug message:

Microsoft Word Detected

Office Web Components Detected

Connecting to VI Server

The argument cannot be null or empty.

where is my mistake?

> if you found this or any other answer useful please consider allocating points for helpful or correct answers <
0 Kudos
1 Solution

Accepted Solutions
alanrenouf
VMware Employee
VMware Employee
Jump to solution

Max,

This script was made for you to run passing it your VI Server as an input to the script, you should not need to ammend the code at all.

As LucD says just run the script like so:

PS> .\report.ps1 vc1

Or if you are loading it into something like powergui script editor type your VI server name in the text box next to the play button.

Sorry for the confusion.

Alan Renouf

http://virtu-al.net

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

How did you start the script ?

Did you do

powershell .\report.ps1 vc1

from a CMD prompt while positioned in the folder where the report.ps1 file is stored ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

alanrenouf
VMware Employee
VMware Employee
Jump to solution

Max,

This script was made for you to run passing it your VI Server as an input to the script, you should not need to ammend the code at all.

As LucD says just run the script like so:

PS> .\report.ps1 vc1

Or if you are loading it into something like powergui script editor type your VI server name in the text box next to the play button.

Sorry for the confusion.

Alan Renouf

http://virtu-al.net

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos