This is probably because you have published desktops - which do not have any "CommandLine".
So you could change the Get-XAApplicationReport line:
foreach( $Application in (Get-XAApplicationReport * ) ) {
to:
foreach( $Application in (Get-XAApplicationReport * | where-object {$_.ApplicationType -ne "ServerDesktop"}) ) {
Then it will not check those published "app".,This is probably because you have published desktops - which do not have any "CommandLine".
So you could change the Get-XAApplicationReport line:
foreach( $Application in (Get-XAApplicationReport * ) ) {
to:
foreach( $Application in (Get-XAApplicationReport * | where-object {$_.ApplicationType -ne "ServerDesktop"}) ) {
Then it will not check those published "app".
... View more