Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Embed PowerShell scripts inside batch scripts (.cmd/.bat)

:: Call ps2cmd.cmd with the filename of the PowerShell script to convert
ps2cmd.cmd example.ps1
:: A example.ps1.cmd will be created

Example

With a PowerShell script example.ps1:

Write-Host Hello World!

We run ps2cmd:

> ps2cmd.cmd example.ps1

And get example.ps1.cmd:

SET PS2CMD_ARGS=%* & PowerShell.exe -NoProfile -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACQAZQBuAHYAOgBQAFMAMgBDAE0ARABfAEEAUgBHAFMAOwAgAGYAdQBuAGMAdABpAG8AbgAgAHMAdABlAHAAMgAgAHsAIABXAHIAaQB0AGUALQBIAG8AcwB0ACAASABlAGwAbABvACAAVwBvAHIAbABkACEADQAKACAAfQANAAoAcwB0AGUAcAAyACAAJABlAG4AdgA6AFAAUwAyAEMATQBEAF8AQQBSAEcAUwA=

Usages

Used in Nerven.Bygge to get the complete setup script in a single, easily executable, script file.

License

The MIT License (MIT) (see LICENSE.txt)

About

Embed PowerShell scripts inside batch scripts (.cmd/.bat)

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.