Created
May 16, 2016 20:18
-
-
Save shmuelie/73ec2c707eed0ef9a8d721f0e9995aeb to your computer and use it in GitHub Desktop.
PowerShell Packaging
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
#Package Current Folder | |
Get-ChildItem .\ -File -Recurse -Force | select @{"Label"="Name";Expression={$_ | Resolve-Path -Relative}},@{"Label"="Data";Expression={[convert]::ToBase64String(($_ | Get-Content -Encoding byte -ReadCount 0))}} | ConvertTo-Json | Set-Content .\Package.json | |
#Unpackage | |
Get-Content .\Package.json | ConvertFrom-Json | ForEach-Object { Set-Content -Encoding Byte -Value ([convert]::FromBase64String($_.Data)) -Path $_.Name } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment