So after a little bit of searching a came across the PowerShell ISE.
Now thats nothing new, but what i didn't know is that you can add "add ons" to the ISE and with that it becomes even more fun.
To be able to add color coded PowerShell code to your blog install the module "IsePackV2"
If you haven't set Chocolatey and PSGallery as Packagesource and trusted them then run:
Get-PackageProvider -Name PSGallery -Force Set-PackageSource -Name PSGallery -Trusted Get-PackageProvider -Name Chocolatey -Force Set-PackageSource -Name Chocolatey -TrustedThis Add on needs some additional modules so we'll install all in one go.
You can run this in PowerShell Ise or regular PowerShell but both must be run with elevated permissions:
Install-Module IsePackV2 -AllowClobber -Force Install-Module ShowUI -AllowClobber -Force Install-Module RoughDraft -AllowClobber -Force Install-Module Pipeworks -AllowClobber -Force Install-Module EZOut -AllowClobber -Force Install-Module ScriptCop -AllowClobber -Force Import-Module IsePackV2When running the PowerShell ISE as Administrator and running Import-Module IsePackV2 there will be some error. I don't know where it comes from, i'll have to look in to that later.
But for now the thing your looking for is the add on we just added.
The way this is as follows.
Your type some stuff in the script pane in the ISE.
Awesome, it helped me post the script with colors. Thanks a lot.
ReplyDelete