I'm trying to use AWS SSM Document RunPowerShellScript action to check if a particular application is installed on Windows servers. The PowerShell script is very simple, but Doucment validation keeps failing.
The PowerShell script does contain a registry path, which does contain columns and back slashes. I suspect this may contribute to the problem. Tried with changing all the back slashes to forward slashes with no luck.
schemaVersion: "2.2"
description: "Command Document to check if This Software is installed"
mainSteps:
- action: "aws:runPowerShellScript"
name: "CheckThisSoftware"
inputs:
runCommand:
- "$ResultMsg = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName -Contains 'Software Name Here'",
- "Write-Output $ResultMsg"
Keep getting InvalidDocumentContent: null
while tries to submit the document.