7 Replies Latest reply on Sep 27, 2015 12:14 AM by Don Kim

    Using a command with quotes in a Command Asset during Compliance

    Steffen Kreis



      our Windows-Engineering wanted to create a Compliance Rule that runs a certain PowerShell line and validates the Output of it.


      In the particular case they want to check the size of the RSCD folder size and make sure it does not contain a large number of Transaction/Temporary files.


      While we sure could be able to solve that differently i wanted to look at that in more general as we seem to be unable to run any Command that contains quotes.


      So for example, we would like to run:


           powershell.exe -inputformat none -command "(ls -r 'C:\Program Files\BMC Software' | measure -s Length).Sum"


      and validate its output as an Integer.


      I am unable to get that to work in any way inside the Command asset of a Compliance rule.


      We could even use a more simple example, which i am also unable to run:

           powershell.exe -inputformat none -command "Write-Host hello"


      Also for this one i am unable to get this working as the console is not even allowing me to save it.


      Has anybody made similar experiences and is able to help ?

      This is for BSA 8.6.1