Jump to content

Whats wrong with my Powershell script?

aDoomGuy
Go to solution Solved by RiffTheRaff,

Try run

Start-Process powershell -verb runas -Argumentlist '-File "G:\Backup installasjon\Scripts\apps.ps1"'

 

Hey,

 

anybody might know what's wrong with this? I tried running it with right click and command inside elevated Powershell window:

 

Start-Process powershell -verb runas -Argumentlist "G:\Backup installasjon\Scripts\apps.ps1"

Window just pops up and dissapears. Script is below (I tried removing "exit" at the end to see if it gave any errors (I think this worked when I first made it).. Anyway, it is supposed to launch installers one by one.

 

Start-Process -Wait -FilePath "G:\Backup installasjon\IE341_2208a.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\ied_1_1_01.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Unigine_Heaven-4.0.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Creative_Cloud_Set-Up.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\PMHOME.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\SDI_R2201\SDI_x64_R2201.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\OfficeSetup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\UltimateSetup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\RoboForm-v9-Setup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Battle.net-Setup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\bitdefender_windows_139f93f1-e788-40ce-bd81-da563000e38e.exe" -ArgumentList "/S /v /qn" -passthru

Regards,

 

Script kid. 😅

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Robchil said:

something demanding .net or something installed to work? 

 

Don't think so. Not for the installers to work anyway. I tried to launch the 4 first ones manually and that worked. Creative Cloud installer was missing but I downloaded that, moved the installers to their own subfolder, updated script and commented out a couple of the installers. It also seems that MS Office installed even though I tried to stop it lol so I'll comment out that aswell. (from the manual run) 😅

 

Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\IE341_2208a.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\ied_1_1_01.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\Unigine_Heaven-4.0.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\Creative_Cloud_Set-Up.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\PMHOME.exe" -ArgumentList "/S /v /qn" -passthru
#Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\OfficeSetup.exe" -ArgumentList "/S /v /qn" -passthru
#Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\UltimateSetup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\RoboForm-v9-Setup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\Battle.net-Setup.exe" -ArgumentList "/S /v /qn" -passthru
#Start-Process -Wait -FilePath "G:\Backup installasjon\Installer\bitdefender_windows_139f93f1-e788-40ce-bd81-da563000e38e.exe" -ArgumentList "/S /v /qn" -passthru

 

Link to comment
Share on other sites

Link to post
Share on other sites

31 minutes ago, aDoomGuy said:

Hey,

 

anybody might know what's wrong with this? I tried running it with right click and command inside elevated Powershell window:

 

Start-Process powershell -verb runas -Argumentlist "G:\Backup installasjon\Scripts\apps.ps1"

Window just pops up and dissapears. Script is below (I tried removing "exit" at the end to see if it gave any errors (I think this worked when I first made it).. Anyway, it is supposed to launch installers one by one.

 

Start-Process -Wait -FilePath "G:\Backup installasjon\IE341_2208a.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\ied_1_1_01.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Unigine_Heaven-4.0.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Creative_Cloud_Set-Up.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\PMHOME.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\SDI_R2201\SDI_x64_R2201.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\OfficeSetup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\UltimateSetup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\RoboForm-v9-Setup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\Battle.net-Setup.exe" -ArgumentList "/S /v /qn" -passthru
Start-Process -Wait -FilePath "G:\Backup installasjon\bitdefender_windows_139f93f1-e788-40ce-bd81-da563000e38e.exe" -ArgumentList "/S /v /qn" -passthru

Regards,

 

Script kid. 😅

set-executionpolicy remotesigned

Set-ExecutionPolicy unrestricted

Set-ExecutionPolicy Bypass

M.S.C.E. (M.Sc. Computer Engineering), IT specialist in a hospital, 30+ years of gaming, 20+ years of computer enthusiasm, Geek, Trekkie, anime fan

  • Main PC: AMD Ryzen 7 5800X3D - EK AIO 360 D-RGB - Arctic Cooling MX-4 - Asus Prime X570-P - 4x8GB DDR4 3200 HyperX Fury CL16 - Sapphire AMD Radeon 6950XT Nitro+ - 1TB Kingston Fury Renegade - 2TB Kingston Fury Renegade - 512GB ADATA SU800 - 960GB Kingston A400 - Seasonic PX-850 850W  - custom black ATX and EPS cables - Fractal Design Define R5 Blackout - Windows 11 x64 23H2 - 3 Arctic Cooling P14 PWM PST - 5 Arctic Cooling P12 PWM PST
  • Peripherals: LG 32GK650F - Dell P2319h - Logitech G Pro X Superlight with Tiger Ice - HyperX Alloy Origins Core (TKL) - EndGame Gear MPC890 - Genius HF 1250B - Akliam PD4 - Sennheiser HD 560s - Simgot EM6L - Truthear Zero - QKZ x HBB - 7Hz Salnotes Zero - Logitech C270 - Behringer PS400 - BM700  - Colormunki Smile - Speedlink Torid - Jysk Stenderup - LG 24x External DVD writer - Konig smart card reader
  • Laptop: Acer E5–575G-386R 15.6" 1080p (i3 6100U + 12GB DDR4 (4GB+8GB) + GeForce 940MX + 256GB nVME) Win 10 Pro x64 22H2 - Logitech G305 + AAA Lithium battery
  • Networking: Asus TUF Gaming AX6000 - Arcadyan ISP router - 35/5 Mbps vDSL
  • TV and gadgets: TCL 50EP680 50" 4K LED + Sharp HT-SB100 75W RMS soundbar - Samsung Galaxy Tab A8 10.1" - OnePlus 9 256GB - Olymous Cameda C-160 - GameBoy Color 
  • Streaming/Server/Storage PC: AMD Ryzen 5 3600 - LC-Power LC-CC-120 - MSI B450 Tomahawk Max - 2x4GB ADATA 2666 DDR4 - 120GB Kingston V300 - Toshiba DT01ACA100 1TB - Toshiba DT01ACA200 2TB - 2x WD Green 2TB - Sapphire Pulse AMD Radeon R9 380X - 550W EVGA G3 SuperNova - Chieftec Giga DF-01B - White Shark Spartan X keyboard - Roccat Kone Pure Military Desert strike - Logitech S-220 - Philips 226L
  • Livingroom PC (dad uses): AMD FX 8300 - Arctic Freezer 64 - Asus M5A97 R2.0 Evo - 2x4GB DDR3 1833 Kingston - MSI Radeon HD 7770 1GB OC - 120GB Adata SSD - 500W Fractal Design Essence - DVD-RW - Samsung SM 2253BW - Logitech G710+ - wireless vertical mouse - MS 2.0 speakers
Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, 191x7 said:

set-executionpolicy remotesigned

Set-ExecutionPolicy unrestricted

Set-ExecutionPolicy Bypass

Thanks still same result though.

 

EDIT: Tried running them manually before script and after that didn't work I put them in the script just to see.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, RiffTheRaff said:

Try run

Start-Process powershell -verb runas -Argumentlist '-File "G:\Backup installasjon\Scripts\apps.ps1"'

 

Yes this. Thank you!

 

Hmm couple of the installers didn't like something though. Probably nothing we can do about that apart from run manually I guess..

I think they both are programs relating to the Sony Camera. I tried to run it and just cancel the installs to see if it worked and all apart from IE341_2208a.exe and PMHOME.exe worked as expected. Think I'll just remove them and put Creative Cloud last because after installing that the script seemed to fall asleep.

Skjermbilde 2023-02-12 152032.png

Skjermbilde 2023-02-12 152739.png

Link to comment
Share on other sites

Link to post
Share on other sites

Not all installers support the same command line arguments. So maybe you have to check each installer for it's command line arguments for silent installation.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, RiffTheRaff said:

Not all installers support the same command line arguments. So maybe you have to check each installer for it's command line arguments for silent installation.

Yeah agreed. The point of these are simply to automate as mush as possible to remove the headache as much as possible when reinstalling OS. Also Creative Suite installer self destructs after installation. That's why it was missing before. 😅

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×