Closed SCHEFFRA closed 2 months ago
Thank you so much for this! Now I don't have to go and search for it.
Will test it out in the development branch and add to main if it works.
I have created a different method using cmd, took me some time to get it working, it gives an error when ran but it will still launch the software without the need of looking for powershell at all. Enjoy :)
"# Creates Desktop Shortcut for the Chris Titus Windows Utility So You Can Easily Launch it to Install Programs $path = "C:\Users\Default\Desktop\Launch-CTT-WinUtil.bat" $content = '@echo off & net session >nul 2>&1 || powershell -Command "Start-Process \"cmd.exe\" -ArgumentList \"/c %~f0\" -Verb RunAs" && exit /B & powershell.exe -Command "iex (iwr \"https://www.christitus.com/win\")"'
Update: found a fix for the error and boon issue, pull request created.
A text file with a short how to, on how to run iwr -useb https://christitus.com/win | iex
would be cool too.
Thanks for all the contributions and ideas, it's now fixed in https://github.com/memstechtips/UnattendedWinstall/commit/a9348a19ad425bb840c2a3e4e67501a81715ef66
Seems that the Powershell script "LAUNCH-CTT-WINUTIL.ps1" has to be executed with admin permission, so it would be helpfull to integrate also the right click option like "run with powershell (admin)"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)\Command] @="\"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\"%1\\"' -Verb RunAs}\""