I'm trying to pass a parameter from the command line in powershell that works as long as there's no space in the parameter. How do I get it to continue to recognize it even with a space?
[Parameter(Mandatory=$True)]
[string]$EmailSubject,
If I run powershell ./Get-Attachment.ps1 -EmailSubject "New files"
it will complain
A positional parameter cannot be found that accepts argument 'files'
If I run powershell ./Get-Attachment.ps1 -EmailSubject "New"
it has no issue.
If I run powershell ./Get-Attachment.ps1
it will prompt me for the EmailSubject then I can put in "New files" and it has no issue.