SMSAgentSoftware / MEM

Microsoft Endpoint Manager related resources
26 stars 15 forks source link

Update Remediation.ps1 #7

Closed chrisnelmes closed 1 year ago

chrisnelmes commented 1 year ago

Structure of the update file has changed from Microsoft, it no longer contain cab files and directly contains MSI files

SMSAgentSoftware commented 1 year ago

Thanks for pointing this out! I've modified your proposed changes a little and updated the main branch directly.

chrisnelmes commented 1 year ago

Thanks Trevor, really appreciate you open-sourcing this script.

chrisnelmes commented 1 year ago

@SMSAgentSoftware, I've noticed something else, I've had to escape the spaces in MSI path, otherwise the msiexec process fails. This did it for me.

$File = Get-Childitem -Path "$MsiLocation*.msi" -File $MsiPath = ""$($File.FullName)""

Write-Host $MsiPath

Install the MSI

$Process = Start-Process -FilePath msiexec.exe -ArgumentList "/i $MsiPath /qn /norestart" -Wait -PassThru