Mike
asked on
Need Help crating powershell Install script
Greeting Experts -
Need help setting up a PowerShell script to install a piece of client software (WindowsSensor.exe) on the list of computers. Can somebody help me write a script that will prompt me for my Admin Credentials, copy the software from a file directory (source file) to folder on the local computer, and then start the install from the command line using these install arguments
software: WindowsSensor.exe
CLI Install arguments: WindowsSensor.exe /install /quiet /norestart CID=InstallToken
Need help setting up a PowerShell script to install a piece of client software (WindowsSensor.exe) on the list of computers. Can somebody help me write a script that will prompt me for my Admin Credentials, copy the software from a file directory (source file) to folder on the local computer, and then start the install from the command line using these install arguments
software: WindowsSensor.exe
CLI Install arguments: WindowsSensor.exe /install /quiet /norestart CID=InstallToken
ASKER
I getting the following error message below... Do you have any idea's
Exception calling "GetFileNameWithoutExtension" with "1" argument(s): "Illegal characters in path."
At line:10 char:56
+ $scriptname = [io.path]::GetFileNameWithoutExtension($(Split-Path $script -Leaf) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
David, $machinearray is called on line 80 of my script and should never be called within the $init scriptblock.
The error in line 10 is generated because the script presumes it has been saved and not merely in the editor of ISE. Save the script somewhere and change the appropriate values for the name of the file containing the computer names in line 7.
Mike, what is your level of Powershell proficiency? If you are not proficient, I can provide you with a commented copy of the code.
I use a framework I wrote in Powershell to perform parallel execution across hundreds of sites simultaneously and that is what I used for this script.
The error in line 10 is generated because the script presumes it has been saved and not merely in the editor of ISE. Save the script somewhere and change the appropriate values for the name of the file containing the computer names in line 7.
Mike, what is your level of Powershell proficiency? If you are not proficient, I can provide you with a commented copy of the code.
I use a framework I wrote in Powershell to perform parallel execution across hundreds of sites simultaneously and that is what I used for this script.
ASKER
I am new to PS... I know how to write a simple script... but nothing to the level of this one.
ASKER
Thanks, the script worked
ASKER
Thanks for the help
I find it a bit odd that I did not receive even partial credit as your solution originated from my script.
Open in new window
This should be close. Look at the end and, if your Exchange/SMTP mail server won't allow relaying, simply delete the last 9 lines.This should prompt you for your credentials then run the script in parallel against a provided CSV file of machine names. The column header for the Machine Name field MUST be "Machine Name" unless you choose to modify the code.