-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utils folder include a script to decrypt securestring (#682)
* Enable two test cases, and drop the workaround for x-ms-enum * Add utils folder include a script to decrypt securestring
- Loading branch information
Showing
6 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#This script converts securestring to plaintext | ||
|
||
param( | ||
[Parameter(Mandatory, ValueFromPipeline)] | ||
[System.Security.SecureString] | ||
${SecureString} | ||
) | ||
|
||
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) | ||
try { | ||
$plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) | ||
} finally { | ||
[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) | ||
} | ||
|
||
return $plaintext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters