The package PowerCLI script in the Windows executable file / install

What are the options for packaging / embed PowerCLI script in Windows. EXE file? I would like for several departments to be able to run and collect information from the script without having direct access to the code. This would ensure that the code has been correctly run without modification.

I know that PowerCLI will be available on these systems, searching for the PowerCLI is not necessary.

I read that the Primal Script has this ability, but I want a solution that is free and easy to use, if possible.

If it is not an executable file, maybe even a file coded which makes it difficult for a layman to make changes.

Thanks in advance for the help!

I used a similar function of Johan Akerstrom in the past (since I don't have the community installed Extensions).

See his post Powershell script to generate an executable from a powershell script .

For this one, I know there is no problem with parameter passing.

Take this example script

param(
[parameter(Mandatory = $true)][string[]]$server)

[void][system.reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
Add-PSSnapin -Name VMware.VimAutomation.Core

Connect-VIServer -Server $server[windows.forms.messagebox]::Show("Connected to " + $defaultViServer.Name)
$VM = Get-VM[windows.forms.messagebox]::Show("I counted " + $VM.Count + " guests")

Disconnect-VIServer -Confirm:$false

Note that the script uses Windows Forms to the output data.

You create the EXE file as follows. I recorded the example script under DoExeTest.ps1

PS C:\Scripts >.\DoExeTest.ps1 new-PSExecutable
Script source file: C:\Scripts\DoExeTest.ps1
Output executable: C:\Scripts\doexetest.exe

And when you run this, it displays 2 message boxes, one with the name of the vCenter and the other with the number of guests, the script is located in the vCenter.

C:\Scripts>doexetest.exe 'Site '.

              

Tags: VMware

Similar Questions

  • on my laptop running windows 7 more information disappeared from the window - topics (file, publishing, display, etc.), address bar and navigation buttons - everything I can see tabs - how do the lack of points to display

    Missing on my laptop running windows 7, all the info displayed at the top of the home page. All headings, i. e. file, change the view etc. disappeared. There is no address bar. There is no "home button", the button refresh, etc.. My wife was using the machine when it happened, so I don't know what she was doing. How to restore these features?

    most of the information has disappeared from the window - topics (file, publishing, display, etc.), address bar and navigation buttons

    When all the toolbars are missing, you are probably in full screen view, press F11 to toggle mode full-screen, or you can move the cursor to the top of the screen.

    The real problems you describe all set thanks to an extension and customization, see 01:10 steps later...

    You can make Firefox 5.0 looks not like Firefox 3.6.19, see numbered 1 to 10 points in the next topic difficulty Firefox 4.0 UI toolbar, problems (Make Firefox 5.0, or 4.0.1 resemble 3.6). If you make changes, you must be aware of what has changed and what it takes to use changed or missing features.

    It is much more beyond these first 10 steps in the list, if you want to make Firefox more functional.

    Toolbars and their contents have been rearranged and buttons have been merged dual-use, the net result is that I could see about 25% of what I had before and recorded about 10% of the area of the toolbar with great loss of functionality to hide things that might already be hidden and to create confusing buttons that already have keyboard shortcuts and don't need to be seen. The only good thing that has been ' Ctrl + / ' has been added to hide/show the modules bar that has not replaced the status bar.

  • The folder list is not the WIndows shortcut files

    Hello

    Why the 'Folder list' vi does not have the Windows shortcut files? Short WIndows files have an extension of "*.lnk", I'm using Labview 2011 SP1 on a WIndows XP Professional computer, the shortcut files on a mapped network drive.  I can find the files of shortcut if an open one window cmd and use the dir command.

    A potential problem is that you might be looking at the wrong place. A shortcut to a file appears in the list of files, and a shortcut to a directory appears in the list of directories. However (at least LV2011) shortcuts to directories that don't exist - as a disconnected network drive - as highlighted in the list of files.

    Mike...

  • What is the purpose of the Windows.edb file?

    I found a few relevant judicial artifactics examining the Windows.EDB file.  I'm looking for a file from a Microsoft source Windows.edb difinitive explanation.

    There is no source of Microsoft here.  We are all volunteers, not employees of Microsoft, Windows users help other users of Windows.  If you want a definitive answer and official, you must use a method on the Microsoft web site "contact us" to connect with Microsoft.

  • Cannot reinstall Windows Vista because the Windows.old file is corrupted.

    I hope someone can help! I'm about to pull out my hair! :)

    I have a laptop Dell Inspiron 1720, under Windows Vista Home Premium, with 3 GB of ram. SP2

    I had problems with error messages

    Here are some of the messages I was getting.

    "Dell Quickset has stopped working"

    "Windows Management Instrumentation has stopped working"

    "The user profile service has stopped working".

    "Windows Update has stopped working"

    There were a couple more but I do not remember. They are all gave me the ability to check online for a solution I have chosen and the message would go for a while, but not forever.

    I'm tired of dealing with him, so I used my Dell disk to reinstall Vista. I did not choose the repair option first. I chose to do a clean install. When I got to the last step where it says "Complete the Installation", it gave me an error message telling me that the "Windows.old" file is corrupted. I do not have wright the rest of the information down, but he told me to run the check disk utility. (I think it has been shown as chkdsk). I clicked 'OK' and the screen went black and stayed like that for an hour. I turned off the computer and repeat all the steps but always goes to the black screen and stops. I tried to use the fix and it found a problem immediately and that fixed it, but after reboot, same thing. Yesterday I ran again the repair option, and it still works today. All night and nothing. She is still ongoing as I type this message. My question is how to run disk utility to check without an operating system installed? Use the "Diagnostic" option when I boot the disk from Dell? Any ideas on how I can get reinstalled Vista?

    Boot from the Dell cd and run diagnostics

  • How to clear the Windows.edb file in Windows 8

    DISPLAY TO THE CLIENT ACCOUNT *.

    The customer has a PC under Windows 8, and he wondered how to remove the Windows.edb file. He recorded 60 GB of information. Is it possible to have the option of Windows search and have this file shrunk down to the size? Is it possible to empty this folder? Anyone have any suggestions on how to deal with this problem?

    Please respond with more information.

    Thank you very much for the help!

    I just had this problem myself, with a clue consuming 107/278 GiB!

    Here's the trick:
    (1) search for "Indexing Options" (under "settings"). Open it.
    (2) search for 'services' (or run "services.msc") and find "Windows Search". Stop the service.
    (3) remove the Windows.edb file
    4) click on "Change" in the Panel "Indexing Options" already open, then click on "Erase and rebuild" for the index. You can also specify another drive to store the index on.
    Hope that helps.
  • Is there any command in the windows command file that is similar to the unix grep command

    Hello

    I have a batch file that returns the status of the database to a file ex: "OPEN." Now I want to read the output file and search for the string 'OPEN' to an another batch file. any suggestions?. This is similar to the unix "grep" command I want to be done in the windows batch file.

    It's my real batch file

    REM - Description: check whether the database is in PLACE
    REM - use:
    REM - ORACLE_SID is an input for the file parameter
    REM-

    REM - beginning of batch file
    off @echo
    Set ORACLE_SID = %1
    (
    echo connect plp/ltd1plp@%1
    ECHO has put cmdsep on
    ' set cmdsep echo ' ' '; --"
    echo term on
    c:/status_log.log reel Echo
    echo select status from v$ instance;
    Reel echo off
    ) | sqlplus/nolog
    REM - end batch file



    Thank you.

    The same link of [google cache | http://209.85.229.132/search?q=cache:EJrm9tgj0a8J:www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx+windows+find&cd=1&hl=en&ct=clnk&client=opera]. You can also use help:

    find /?
    
  • 910219. how to download and keep the Windows Update files?

    Hello

    What is the ideal way to update Windows? now, Windows downloads the selected updates. where? I do not know! and after their installation, it removes the packages for installation on my computer. This causes the downloaded updates are lost, and I can't use them to similar machines that need to install the same updates. for these machines, I have to download updates again! This causes my internet to be charged again while it is not really necessary.

    the ideal way, in my view, is that I can specify a folder for the Windows Update service. It can use a default folder for that also. After selecting the updates, I want to install in my system, it checks to see if the update is already existing in the folder. only if NOT it downloads. then after downloading it maintains the package in the same folder after installing. installation should be done automatically as it is done now. Then I can move the folder to another machine. in the second machine, I also choose the update I want to be installed which are mostly the same as the first machine. for example, Windows Update only consumes my internet traffic for updates that are not yet downloaded. I wonder why Windows Update doesn't currently work the same way?

    by this method, I can at least use the consumption of traffic and I can access the latest updates with the easier and faster way. I I would like to choose a memory flash for this purpose and keep the folder inside.

    is there a way to achieve this?

    THX

    Security updates are available on image files CD ISO-9660 starting from Microsoft Download Center

    http://support.Microsoft.com/kb/913086>

    You can also download individual updates from the catalog and save to be installed later.

    http://v4.windowsupdate.Microsoft.com/catalog/en/default.asp>

    You can also download individual updates from the catalog and save to be installed later.

    http://catalog.update.Microsoft.com/v7/site/home.aspx>

    Click the Add button for each update you want to download. Once you have what you want, click on the link "go to download basket. Type or browse to the location where you want the saved updates to and then click on the button "Download Now".

    Once downloaded, you can then burn to CD or Flash...

    How to download drivers and updates from the Windows Update Catalog or the Microsoft Update Catalog

    http://support.Microsoft.com/kb/323166>

    Other links that may be useful:

    Search for a download

    http://www.Microsoft.com/downloads/search.aspx?displaylang=en>

    How to install multiple Windows updates or hotfixes with only one reboot

    http://support.Microsoft.com/?kbid=296861>

    For security and other fixes published for a given month:

    http://www.Microsoft.com/technet/security/bulletin/Ms#-* .mspx >

    Replace # with two-digit year

    Replace * with the three-character month abbreviation

    There are reported for that month, you will see the list of 'critical' patches 'important' for this month

    Check the 2nd Tuesday of each month - later in the day.

    For just the list:

    http://www.Microsoft.com/technet/security/current.aspx>

    Courtesy of MVP Harold Horne

    UTC/GMT is 12:58 on Wednesday, May 9, 2012

  • Try to download the windows error message install 3.1 is "is not a valid win32 application.

    I'm missing some drivers and try to download it from the dell site.  Watch I need to install windows, but I can't seem to load. »

    The system is windows XP Home edition 2002 Service Pack 2

    Hi Craig,.

    -Where you download Windows Installer from?

    Possible causes of this error are:

    -The file is corrupt, missing, or bad.

    -The file is not designed for your version of Windows.

    If the file or program you are trying to run is damaged or missing, Windows will be unable to run the file correctly and generates this error message. Re-download the file install the same.

    In addition, see the following articles to solve the problems of Windows Installer:

    Problems installing and uninstalling programs on Windows computers

    Basic troubleshooting steps for Windows Installer

    On a side note, I recommend you upgrade to Service Pack 3 to continue to receive updates for Windows XP security.

    Find out How to obtain the latest Windows XP service pack

  • Can I safely remove the Windows.old files?

    What's up guys?, I have a Compaq Presario supplied with the Windows Vista operating system, 32-bit. I backed up all my drivers on DVD and I downloaded a clean copy of Vista using an ISO on a DVD burner. I reinstalled the new copy put in my original product key, and he agreed. I reinstalled my drivers and all seems to work fine. I transferred all my data, mp3, jpeg, etc. for Flash readers and/or new programs on the new OS. The reason for the new OS was a virus infection which partially damaged the registry.  I really want to keep these files in the system for obvious reasons. Can I safely delete the files "Windows.old" and what would be the best way to do it?

    Hello

    The next message will be how carefully check for malicious software needed
    for, now or in the near future.

    --------------------------------------------------------------------------

    In the disk cleanup, is displayed as previously the Windows Installations.

    Start - type in the search box-> CONTROL the above disk cleanup - right Click-RUN AS ADMIN.

    How to remove the Windows.old folder in Windows 7
    http://www.SevenForums.com/tutorials/19151-Windows-old-folder-delete.html

    How can I remove the Windows.old folder?
    http://Windows.Microsoft.com/en-us/Windows7/how-do-I-remove-the-Windows-old-folder

    How to remove the Windows.old folder that is generated when you perform a custom
    Windows Vista Setup (also Windows 7)
    http://support.Microsoft.com/kb/933212/en-us

    How to remove and delete the folder Windows.old on Vista or Windows 7
    http://www.kodyaz.com/articles/delete-Windows-old-removal.aspx

    ===============================================

    If necessary:

    1. open an elevated command prompt

    Start - type in the search box-> find CMD in top - click right on - RUN AS ADMIN

    How to open a high in Windows 7 command prompt
    http://www.SevenForums.com/tutorials/783-elevated-command-prompt.html

    2 prompt probably like C:\Windows\System32 >

    This type at the prompt, and then press ENTER.

    CD\

    Now, the line should look like C:\ >

    3: This type at the prompt, and then press ENTER.

    Windows.old DIR

    Should resemble C:\>DIR Windows.old

    It should return

    C:\Windows.old directory

    and view the contents of Windows.old

    It's just to make sure that the Windows.old folder is under C: (drive C) - if she does not STOP

    4 this type at the prompt, and then press ENTER.

    Attrib - r - / s has s h Windows.old

    Should look like C:\>Attrib/s - r - a s h Windows.old
    (there are SPACES between Attrib and / s and r - and - a and -s-h and Windows.old)

    He should return to the prompt C:\ if it shows and ERROR and STOP - then check the command
    and if it has been entered correctly you are not in the right place.

    5 this type at the prompt, and then press ENTER.

    RD/s Windows.old

    Should resemble C:\>RD/s Windows.old
    (there are SPACES between the RD /s and Windows.old)

    Return Windows.old, are your sure Y/N Y type

    (If you get a message that you have no property rights then type this command
    and press ENTER.

    TAKEOWN /f Windows.old/a/r

    and repeat step 5 - were you using an elevated command prompt?

    6: This type at the prompt, and then press ENTER.

    Windows.old DIR

    Should look like C:\>DIR Windows.old - and press ENTER.

    It should return

    Directory of C:\

    File not found

    Which confirms that it is gone.


    7
    close the COMMAND window

    =======================
    =======================

    Use the Safe Mode if possible - repeatedly, press F8 that you start.

    If necessary, use these utilities

    UnLocker 1.91 + (free) 32 and 64 bit versions.
    http://unlocker.emptyloop.com/

    Download - SAVE - go to where you put it-click on - RUN AS ADMIN

    Below also work on both 32 and 64-bit Windows

    Another good alternative - use FileAssassin:

    FileAssassin - free
    http://www.Malwarebytes.org/fileassassin.php

    Force delete (cannot delete) closed or in used files or folders with FileASSASSIN
    http://www.mydigitallife.info/2008/12/27/force-delete-cannot-delete-locked-or-in-used-files-or-folders-with-FileASSASSIN/

    Download - SAVE - go to where you put it-click on - RUN AS ADMIN

    And this - MoveOnBoot

    MoveOnBoot
    http://www.softwarepatch.com/software/MoveOnBoot.html

    I hope this helps and happy holidays!

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • I stop in MSE, causing the Defender; just remove the Windows Defender files?

    original title: Remove Windows Defender files

    I have Microsoft Security Essentials, which will cause Windows Defender be turned off. Windows Defender is not in the Add / Remove Programs, so can I just delete the files from Windows Defender? Debbie

    You can not remove it.

    It is part of the Vista operating system.

    Microsoft Security Essentials has its own integrated version of the defender and it automatically disables the version of Windows Vista defender.

    If it's not:

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-Defender-on-or-off

    Turn Windows Defender on or off the information on the link above of Microsoft.

    See you soon.

    Mick Murphy - Microsoft partner

  • I want to burn a CD of all the Windows Mail files

    I followed the instructions but I can not click & drag the mail files.  They are a cute force.  Did I miss a step?  I had no problem burning photo CD.
    I have a lot of records and I want to redo this part of my mail.  I tried to click on a folder, but there is nothing!
    Any suggestions?

    Hello

    How to make a backup of Windows Mail for Windows Vista
    http://www.ontechnews.com/computer-tips/Web-Internet/how-to-backup-Windows-Mail-for-Windows-Vista/
    Windows Mail for Vista: back up and restore data
    http://ist.mit.edu/services/software/WindowsMail/vistaenterprise/backup

    How to fix most of the problems with Windows Vista Mail - #2 problem
    http://www.Vistax64.com/tutorials/62560-Windows-Mail-problems.html

    Basically your either like to copy the complete electronic file on the CD or export your email and contacts
    and then copy to the CD.

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Why is the Windows backup file larger than the original disk?

    I just used the system on Windows 7 backup utility to back up to an external hard drive (USB). I'm curious to know why the backup hard disk file is 170 GB when my computer has only 103 GB used on a 150 GB C drive. Also, should it more than 8 hours to run?

    When you back up your computer using backup software and that you select the default options in the backup process that you backup not only installation Windows (C:\) but also other files you can have outside of the default installation.  Also, some files may been compressed into your windows installation may have been expanded to ensure that the intergerity backup file.

  • Problems with the display of the windows help files

    Hello

    I use in my computer dell laptop pre-installed genuine Windows 7 Home premium. I try to access my files help, but got this message. "Help for this program was created in format using Windows, which depends on a feature that is not included in this version of Windows. However, you can download a program that will allow you to view help created in the Windows Help format. " .

    Please let me know if there is some way that I can watch my help files in my Windos7.

    Thank you

    Srinivas

    Hello

    I suggest you to refer to this article and check if that helps.

    I can not open the help that was created in Windows Help format (WinHlp32.exe): http://support.microsoft.com/kb/917607

    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: How do I back up and restore the registry in Windows

    For Windows 7: back up the registry: http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    Refer.

    Why can't get assistance from this program? : http://windows.microsoft.com/en-IN/windows7/Why-cant-I-get-Help-from-this-program

    I hope this helps.

  • How to control the Windows updates are installed on the Windows Surface of RT

    I recently had to perform a refresh to solve the problem with desktop on the desktop icons that appear as spaces. After the update, I had to reinstall the update for Office 2013. When I went to Windows Update to do this, I found it with a group of 9 other updates, these 9 were all marked as ready for download and installation, Office 2013 update is not checked. I disabled the office 2013 update and not the other 9 updates, thinking that I could make those after I had Office installed upgrading so I would like to know if my taskbar icon problem has been resolved. At the bottom of the screen even when the Office update was the only update checked I chose to install updates. The Surface actually installed all updates, not only the update of Office.

    Is there a way to control which Windows updates are installed in fact at some point? Unchecking them made no difference.

    Hello

    Welcome to the Microsoft community!

    I understand that you are facing problems while installing Windows updates and want to know if there is a way to control which Windows updates are installed in fact at some point. I'm here to help you.

    I suggest to refer to the following article and perform the steps mentioned there.

    Problems with installing updates

    http://Windows.Microsoft.com/en-us/Windows-8/troubleshoot-problems-installing-updates

    Automatic update of Windows: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows-8/Windows-Update-FAQ

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

    Kind regards!

Maybe you are looking for