I am having problem with powershell arg design like this powershell.exe -NoProfile -ExecutionPolicy Bypass -Command “& { $scriptContent = Get-Content -Path ‘C:pathtoyourscript.ps1’ -Raw; $command = “`$scriptContent -key ‘BlRznMbcP5azbwi4’ -filePath ‘C:pathtoyourfile.txt'”; Invoke-Expression $command }”
And I got some errors like
The string is missing the terminator: “.
- CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
- FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
Because using powershell type them on screen I don’t like to use that way. But they work with command
$scriptContent = Get-Content -Path ‘{0}’ -Raw; Invoke-Expression “& {{ $scriptContent }} -key ‘BlRznMbcP5azbwi4’ -filePath ‘{1}'”
executed on my .net application.
I need someone to correct my argument
ThÀnH DaNh NgUyỄn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.