justingist / posh-ubiquiti Goto Github PK
View Code? Open in Web Editor NEWPowershell tools for Ubiquiti Unifi
Powershell tools for Ubiquiti Unifi
Hi,
i tried to run your Module but kept getting this bullshit:
PS F:\Eigene Dateien\Chris\Downloads> Decrypt-UBNTBKP -ubntbkp .\autobackup_5.9.26_20181029_0600_1540792800030.unf
Create-AesManagedObject : Die Benennung "Create-AesManagedObject" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines
ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den
Vorgang.
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:14 Zeichen:19
+ $aesManaged = Create-AesManagedObject -key $key -IV $iv
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Create-AesManagedObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:15 Zeichen:5
+ $unencryptedData = $decryptor.TransformFinalBlock($encryptedstrin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:16 Zeichen:5
+ $aesManaged.Dispose()
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Ausnahme beim Aufrufen von "WriteAllBytes" mit 2 Argument(en): "Der Wert darf nicht NULL sein.
Parametername: bytes"
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:18 Zeichen:5
+ [io.file]::WriteAllBytes($outfile,$unencryptedData)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
PS F:\Eigene Dateien\Chris\Downloads>
I found these missing functions in your credits O.o Why have you left them out? These are needed. After that i kept getting this error:
PS F:\Eigene Dateien\Chris\Downloads> Decrypt-UBNTBKP -ubntbkp .\autobackup_5.9.26_20181029_0600_1540792800030.unf
Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:15 Zeichen:5
+ $unencryptedData = $decryptor.TransformFinalBlock($encryptedstrin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Ausnahme beim Aufrufen von "WriteAllBytes" mit 2 Argument(en): "Der Wert darf nicht NULL sein.
Parametername: bytes"
In F:\Eigene Dateien\Chris\Downloads\Posh-UBNT.psm1:18 Zeichen:5
+ [io.file]::WriteAllBytes($outfile,$unencryptedData)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
Hm, Whats the problem here... Oh i see. $decrypter.TransformFinalBlock cannot exist at line 15. You forgot the line in front of it!
From PowershellAes.ps1:
function Decrypt-String($key, $encryptedStringWithIV) {
$bytes = [System.Convert]::FromBase64String($encryptedStringWithIV)
$IV = $bytes[0..15]
$aesManaged = Create-AesManagedObject $key $IV
$decryptor = $aesManaged.CreateDecryptor();
$unencryptedData = $decryptor.TransformFinalBlock($bytes, 16, $bytes.Length - 16);
$aesManaged.Dispose()
[System.Text.Encoding]::UTF8.GetString($unencryptedData).Trim([char]0)
}
The 5th line is missing!
Now it ran superb. I will upload a commit with the running Module Version.
To start with you call Create-AesManagedObject but provide no reference to the source other than thanking someone. The code in the basic form does not work. If you are going to share, give more indication of the dependencies so that others can also appreciate your efforts. But for now, it's a flop, doesn't work, a failure. Sorry for the bluntness but really sugar coating it enables laziness.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.