Issue with returned value from Powershell RRS feed

  • Question

  • I have a very basic Powershell script which is not working correctly in Orchestrator. The script simply counts how many files are in a particular directory:

    $FileCount = (Get-ChildItem -Path "\\unc_path" -filter "*.*").Count

    The value is published as an integer. If there are 2 or more files in the folder, the value is set correctly. However, if there are 0 or 1 file in the directory, the value does not get set. I have verified this by writing the value to a text file. I have tried changing the Type of the published value to string, same outcome. I also tried explicitly declaring the variable as an int in the Powershell script, but this also produces the same result.

    Appreciate any feedback that may help.

    Thursday, June 18, 2015 8:45 AM


All replies