>Is there a way to do this in Applications?
Yes, the application model runs a command against your source content. In your example, the command would run your powershell script.
Nash
Thanks Nash. I got my script to run but it doesn't install the software. I can run it manually from the ccmcache folder and it'll install the software but when running the "install.ps1" file from SCCM it doesn't install the software but does copy files to the directory specified. Why would it work one way and not the other? Any ideas?
$CurrentDirectory = Split-Path $MyInvocation.MyCommand.Definition -Parent -Resolve Start-Process -Filepath "msiexec.exe" -ArgumentList /i, "Sharegate.Migration.4.6.1.msi", /q -Wait if ( Get-WmiObject -Class Win32_OperatingSystem | Where-Object { $_.version -match '6.' } ) { md 'C:\ProgramData\ShareGate' -Force Copy-Item -Path "$CurrentDirectory\Sharegate.License.xml" -Destination 'C:\ProgramData\ShareGate' -Force } else { if ( Get-WmiObject -Class Win32_OperatingSystem | Where-Object { $_.version -match '5.' } ) { md 'C:\Documents and Settings\All Users\Application Data\ShareGate' -Force Copy-Item -Path "$CurrentDirectory\Sharegate.License.xml" -Destination 'C:\Documents and Settings\All Users\Application Data\ShareGate' -Force } }
Sorry I was modifying the script and accidently took it out. the second line actually looks like this
Start-Process -Filepath
"msiexec.exe" -ArgumentList /i,
"Sharegate.Migration.4.6.1.msi", /q
-Wait -WorkingDirectory $CurrentDirectory
Hi,
Any updates?
If this problem has not been resolved, please check AppIntentEval.log and AppEnforce.log to see whether there are some helpful information.
" I can run it manually from the ccmcache folder and it'll install the software but when running the "install.ps1" file from SCCM it doesn't install the software but does copy files to the directory specified."
Could this be related to the account running the script? How about running as system account?
Best Regards,
Joyce
Joyce,
I do remember looking at the AppEnforce.log and did not see any errors. I did not check the AppIntentEval.log but will do that hopefully sometime this week. As for the account, all domain users are local admins. I also tried changing line 2 to what I have below here (running non-silent)and I get the same results. It's almost like it skipped this line and moved on to the next. What else can I try to troubleshoot this? Thanks for your help Joyce.
Start-Process
-Filepath "msiexec.exe"
-ArgumentList /i,
"Sharegate.Migration.4.6.1.msi" -Wait -WorkingDirectory $CurrentDirectory
- Edited by Pa Chou Tuesday, May 13, 2014 7:57 PM
- Proposed as answer by Torsten [MVP]MVP, Moderator 18 hours 12 minutes ago