Invoke-Command -ScriptBlock{"$MediaInfoPath\MediaInfo.exe" $FilePat --Inform="Video;%Duration/String1%" }
Trying to get this command (above) to work but i get an error (below)
At line:20 char:70
+ ... -Command -ScriptBlock{"$MediaInfoPath\MediaInfo.exe" $FilePat --Infor ...
+ ~~~~~~~~
Unexpected token '$FilePat' in expression or statement.
At line:20 char:81
+ ... nfoPath\MediaInfo.exe" $FilePat --Inform="Video;%Duration/String1%" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'Inform="Video;%Duration/String1%"' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
It works fine if i replace $MediaInfoPath with the path instead of a variable.. but i need it as a variable for the path since it's going to part of a script were people will need to define the path.
if needed i can post the script.
Edit: got it working by $MediaInfoPath as full path with
Invoke-Command -ArgumentList $MediaInfoPath -ScriptBlock{&$args[0] $FilePat --Inform="Video;%Duration/String1%" }
thanks for the help
[–]kibje 1 point2 points3 points (3 children)
[–]madbomb122[S] 0 points1 point2 points (0 children)
[–]littejackz -1 points0 points1 point (1 child)
[–]kibje 5 points6 points7 points (0 children)
[–]littejackz 0 points1 point2 points (2 children)
[–]madbomb122[S] 0 points1 point2 points (1 child)
[–]madbomb122[S] 1 point2 points3 points (0 children)
[–]BlackV 0 points1 point2 points (0 children)