I am trying to re-install antivirus on multiple computers which requires reboot. I have a script to uninstall the antivirus and reboot but for installation, I have to run another script. Is there anyway to ran only one script which will perform UNINSTALL+REBOOT+INSTALL
Asked
Active
Viewed 1,609 times
1
-
https://stackoverflow.com/questions/24469265/running-a-powershell-script-restarting-and-then-continue-to-run – Glenn Jan 09 '20 at 04:16
-
2Does this answer your question? [Running a Powershell script, restarting and then continue to run](https://stackoverflow.com/questions/24469265/running-a-powershell-script-restarting-and-then-continue-to-run) – PiNaKa30 Jan 09 '20 at 04:23
1 Answers
0
Use this:
cd HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce
new-itemproperty . TheKey -propertytype String -value "Powershell.exe Powershell script"
Restart-Computer

Wasif
- 14,755
- 3
- 14
- 34
-
https://community.spiceworks.com/topic/1334887-restart-a-computer-remotely-using-powershell-and-prompt-for-computer-name-and-un – Patrick Burwell Nov 03 '22 at 15:02