Year: 2018

Though the recommended approach would be to upgrade to PowerShell 5.1 and implement JEA (preferable with DSC and the JEA DSC module), there sometimes might be a need to programmatically add permissions to a PowerShell session configuration. Continuing the mentioned above, and a question asked on the reddit forum, below is an example on how…

A common need for a Remote Desktop Services (RDS) and/or Citrix farm admin, is to remove local profiles from a server. Another example for this, is the question posted a few days ago in the PowerShell.org forum here. Funny thing, about 6 years ago, I wrote a vbscript that does that. It just doesn’t filter…

In a certain scenario, I needed a batch file (bat or cmd extension) that runs PowerShell code, and I could have only one file, so I couldn’t go with the easy way of a batch file calling PowerShell.exe with the -File parameter specifying the path to a ps1 file. For this, I created a special…

A colleague of mine was writing a cool function that tidies up the GPOs, and he wanted to implement the -WhatIf common cmdlet parameter in his function. There’s a simple way of doing that, just add the [cmdletBinding(SupportsShouldProcess)] and the param() blocks in the top of your function, add the if ($PSCmdlet.ShouldProcess($target)) {} in the…

The PowerShell ISE was first shipped with PowerShell 2.0 (November 2006), and greatly improved in PowerShell 3.0 (August 2012), with the PowerShell Tabs, the Show-Command Add-on and the snippets (CTRL+J). But since then, it pretty much stayed the same. Fast forward to May 2017, David Wilson from the PowerShell team announced (amongst other things) that:…