Link to home
Start Free TrialLog in
Avatar of Pete
PeteFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Prevent restart in powershell

I am running a powershell script that installs Adobe CC at startup, it is huge and takes a long time, as the script runs immediately after imaging various other updates, installs etc that are going on seem to make windows reboot before the adobe cc script finishes. Is there a way to prevent restart in my powershell script? any other ideas?

Thanks
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

Hi Pete, it's kind of hard trying to guess what the script you're running is doing.

Probably if it's a powershell search for a Restart-Computer on the text and comment it using a # at the start of the line :)
that should prevent the reboot.
Avatar of Pete

ASKER

sorry the script is not the cause of the restart, I wrote the script. The script is running and some thing else in Windows is causing it to restart.

can I put a command in the powershell script to prevent any/all background restarts?
No

well, actually you could have shutdown /a running every 10 seconds.

More importantly, if the machine is needing to restart for updates, forcing it to not restart isn't ideal. I mean why not let it run through the installations and then install Adobe?

Also, have you considered the Creative cloud packager??

That may help your installation times either way :-)
Avatar of Pete

ASKER

The CC packager is deprecated for Adobe CC 2019 onward, but yes I do use the Admin portal to create the packages, it takes about 15 mins to install during which time something else is rebooting it.

How can I delay the install of adobe until everything else has finished if it's a startup script. After imaging a computer there's a lot of things going on with software and windows updates.

I suppose a few entries of shutdown /a may work...

Thanks
From my experience: some setups are looking for pending reboots (pending as in "windows updates have been installed, but the reboot was not yet carried out") and simply force a reboot, then.
Other setups check for helper components, first - if these are found to be installed, setup continues. If not, setup installs them and if those require a reboot, setup forces a reboot immediately.

Please note that the way you call setup decides this to happen. If you call setup visibly, non-silent, this should not happen but instead indicate the problem and ask for reboot-authorization.

So please test to install using your script without using the silent parameters. This is just in order to find out what is going on.
most installations allow the /norestart i.e. msiexec   /qn /i MSAddInsSetup.msi REBOOT=ReallySuppress /norestart
ASKER CERTIFIED SOLUTION
Avatar of Pete
Pete
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial