I've been tasked with setting up and managing Visual Studio versioning across our Dev PC's.
I've successfully got this up and running, pushing updates to users using Psexec however I would like to add in prompts to advise the users when stages of install are complete or if the setup.exe doesn't run.
I've come to reach the below which of course works fine locally however when running this on a remote users PC the message prompts are not pushed (due to being remote) Is there anyway I could get around this? been trying different psexec commands within the script for the last few days and haven't made much progress :(.
if(get-process setup -ea SilentlyContinue |where-object {-not $.HasExited })
{Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.MessageBox]::Show('Setup already active - exiting')}
else
{start-process cmd.exe "/c \fileshare\layoutshare\vsupdate.bat"}
start-sleep -s 15
if(get-process setup -ea SilentlyContinue |where-object {-not $.HasExited })
{$a = get-process setup
$a.waitforexit()
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.MessageBox]::Show('Installer Update Completed - Advise IT to proceed with next step')
}
else
{Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.MessageBox]::Show('Install Error - Contact IT')}
It's worth mentioning the vsupdate.bat just contains the one line required to run the silent installer.
The way I'm running this remotely is by running the below on my PC in elevated powershell.
psexec -u adminname -p adminpassword -h -i \devicename cmd.exe /c 'echo . | %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -file "\fileshare\layoutshare\vsinstall.ps1"'
I'm at the point where I've written and tested all of this locally - but I'm getting the same result as I would just running the vsupdate.bat directly from psexec, Ideally i'd love the users to get the prompt so they know when the application is useable again/if there is a problem with the install.