While doing the tutorial with azcmagent from the documentation, I ran into the issue that when one of the generated cmdlets was executed with the -Verbose switch, I got an error:
Write-Verbose: A positional parameter cannot be found that accepts argument 'Files\AzureConnectedMachineAgent\azcmagent.exe'.
This is because in the Crescendo configuration file, OriginalName is specified as
OriginalName = "c:/program files/AzureConnectedMachineAgent/azcmagent.exe"
Note the space between program and files.
The Export-CrescendoModule function (or more specifically the GetInvocationCommand method of the Command class) handles this by wrapping OriginalName in double quotes - except for this line:
While doing the tutorial with azcmagent from the documentation, I ran into the issue that when one of the generated cmdlets was executed with the
-Verbose
switch, I got an error:This is because in the Crescendo configuration file,
OriginalName
is specified asOriginalName = "c:/program files/AzureConnectedMachineAgent/azcmagent.exe"
Note the space betweenprogram
andfiles
.The
Export-CrescendoModule
function (or more specifically theGetInvocationCommand
method of theCommand
class) handles this by wrappingOriginalName
in double quotes - except for this line:https://github.com/PowerShell/Crescendo/blob/8a30182fed41c4374461f13c3acbe23baceee5f1/Microsoft.PowerShell.Crescendo/src/Microsoft.PowerShell.Crescendo.psm1#L467