1. Aaron Jensen
  2. Carbon
  3. Issues
Issue #174 resolved

Protect-String throws when module path contains spaces

Simon Garratt
created an issue

On my machine, Carbon (2.0.1) is installed here:

C:\Program Files\WindowsPowerShell\Modules\Carbon\

When I run:

$me = Get-credential 'DOMAIN\User1'
Protect-String -String 'This is a string' -Credential $me

I see

Protect-String : C:\Program : The term 'C:\Program' is not recognized as the name of a cmdlet, function, script file,
or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ C:\Program Files\WindowsPowerShell\Modules\Carbon\bin\Protect-String.ps1 -Protec ...
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

At line:1 char:1
+ Protect-String -String 'This is a string' -Credential $me
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Protect-String

Comments (5)

  1. Log in to comment