Skip to content

Instantly share code, notes, and snippets.

@SteloNLD
Last active April 19, 2018 22:22
Show Gist options
  • Save SteloNLD/5417eba7b84c9ca27f0a5bf887fcea88 to your computer and use it in GitHub Desktop.
Save SteloNLD/5417eba7b84c9ca27f0a5bf887fcea88 to your computer and use it in GitHub Desktop.
Execute Powershell code embeded within [Ps]HTML Files.
# Executes the Powershell HTML file, code prefixed with $( and suffixed with ) will be executed.
# Part of the Portable Powershell Webserver service/script made by @SteloNLD, Sten Lootens ([email protected]).
Function Invoke-PsHTML ($PsHTML_FilePath){
Return Invoke-Expression ('@"
' + $(Get-Content $PsHTML_FilePath) + '
"@')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment