Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I encrypt a file using this script? #3

Open
Polda18 opened this issue Apr 8, 2021 · 0 comments
Open

How can I encrypt a file using this script? #3

Polda18 opened this issue Apr 8, 2021 · 0 comments

Comments

@Polda18
Copy link

Polda18 commented Apr 8, 2021

Hi. I tried to pipe a file output to the script encode input and this is what it says (I've redacted the actual path, that isn't actually important):

PS C:\REDACTED> Get-Content .\REDACTED.EXT | .\PowerRSA.ps1 -Method Enc -Exponent .\rsa\PrivateKey -Modulus .\rsa\Modulus

C:\REDACTED\PowerRSA.ps1 : The input object cannot be bound to any parameters for the command either because the comman
d does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:34
+ ... tage5.ps1 | .\PowerRSA.ps1 -Method Enc -Exponent .\rsa\PrivateKey -Mo ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (#TZsejlAdIwWSuD...CtZSsIfbVKQyxUy:PSObject) [PowerRSA.ps1], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,PowerRSA.ps1

C:\REDACTED\PowerRSA.ps1 : The input object cannot be bound to any parameters for the command either because the comman 
d does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:34
+ ... tage5.ps1 | .\PowerRSA.ps1 -Method Enc -Exponent .\rsa\PrivateKey -Mo ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: ($xzVCMzeJliXK='...xzVCMzeJliXK))):PSObject) [PowerRSA.ps1], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,PowerRSA.ps1

What is going on? How can I encode a file? Do I need to escape those characters at the beginning of the two lines? Does the file need to have only a single line? They're kinda important, both the $ and # characters, and the two lines...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant