Hi All. I am trying to install a application via SCCM. The script is running fine except for my last line to install the application.
I have tried a bunch of things but i think that my issue is that its either not reading the switches or can’t find the script path.
# Get Script Path $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition # Install Android Studio "$scriptPath\android-studio-ide-182.5314842-windows.exe /S /Allusers" # Extract SDK Files Expand-Archive -Path "$PSScriptRoot\AndroidStudioSDK.zip" -DestinationPath "C:\" -Force # Add envro vars $AddPath ="C:\AndroidSDK\platform-tools;C:\AndroidSDK\tools" $Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment" $OldPath = (Get-ItemProperty -Path "$Reg" -Name PATH).Path $NewPath= $OldPath + ';' + $AddPath Set-ItemProperty -Path "$Reg" -Name PATH –Value $NewPath
I have tried a few different things like $PSScriptRoot but when running through SCCM it doesn’t install. I also tried running with start-process and the -argumentlist parameter but that also fails.
I’m not getting anything in the event log and the SCCM log says success (as the script is running)
Anyone know what i’m doing wrong>