0
Good morning
I’m trying to run the powershell script https://github.com/the-xentropy/xencrypt/blob/master/xencrypt.ps1 and both the script and the file I’m trying to encrypt are on the same board
the steps I followed were
Import-Module ./xencrypt.ps1
Invoke-Xencrypt -InFile test.ps1 -OutFile testcrypted.ps1
but gave me the error
Invoke-Xencrypt : Exception calling "ReadAllBytes" with "1" argument(s): "Não foi possível localizar o ficheiro
'C:\Users\DESKTOP\test.ps1'."
At line:1 char:1
+ Invoke-Xencrypt -InFile test.ps1 -OutFile testcrypted.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-Xencrypt], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException,Invoke-Xencrypt
Why is this happening?
Thank you
Thank you for your reply I do
PS C:\Users\IEUser\desktop> $curPath = (Get-Location).Path
PS C:\Users\IEUser\desktop> $inFile = $curPath + "\test.ps1"
PS C:\Users\IEUser\desktop> $outFile = $curPath + "\testcrypted.ps1"
PS C:\Users\IEUser\desktop> Import-Module ./xencrypt.ps1
PS C:\Users\IEUser\desktop> Invoke-Xencrypt -InFile $file -OutFile $outFile
but I get– ampf27
The variable '$file' cannot be retrieved because it has not been set. At line:1 char:25 + Invoke-Xencrypt -Infile $file -Outfile $outfile + ~~~~~ + Categoryinfo : Invalidoperation: (file:String) [], Parentcontarroinserrecordexception + Fullyqualifiederrorid : Variableisundefined
– ampf27
There was a typo in the Answer... just updated it, check it Again.
– Bruno Warmling
Getting the error 'Invoke-Xencrypt : Exception Calling "Readallbytes" with "1" argument(s): "Could not find file 'C: users ieuser desktop test.ps1'." At line:1 char:1 + Invoke-Xencrypt -Infile $infile -Outfile $outfile + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Categoryinfo : Notspecified: (:) [Invoke-Xencrypt], Methodinvocationexception + Fullyderrorid : Filenotfoundexception,Invoke-Xencrypt'
– ampf27
Try to run it as administrator
– Bruno Warmling
Thank you very Much. It worked
– ampf27