You've already forked SharedScripts
mirror of
https://github.com/jaapbrasser/SharedScripts.git
synced 2025-12-24 21:51:38 +02:00
15 lines
505 B
PowerShell
15 lines
505 B
PowerShell
Function ConvertTo-CompressedBase64 {
|
|
[cmdletbinding()]
|
|
param(
|
|
[Parameter(
|
|
ValueFromPipeline=$true
|
|
)]
|
|
[string] $InputObject
|
|
)
|
|
$ms = New-Object System.IO.MemoryStream
|
|
$cs = New-Object System.IO.Compression.GZipStream($ms, [System.IO.Compression.CompressionMode]::Compress)
|
|
$sw = New-Object System.IO.StreamWriter($cs)
|
|
$sw.Write($InputObject.ToCharArray())
|
|
$sw.Close()
|
|
[System.Convert]::ToBase64String($ms.ToArray())
|
|
} |