Category: PowerShell

In my blog post “Invoke a remote command without WinRM, psexec or similar – Access administrative shares even if they have been removed” I demonstrated how to use WMI to execute a command on a remote computer. The task was pretty simplistic as I only had to create a share....

In one of my last posts I mentioned that for me the CIM CmdLets have been faster than the WMI CmdLets. I referred mainly to my personal impression working with these CmdLets for quite some time on a pretty large array of different servers and tasks and supported this statement...

In my last post, I explained how to solve one of the stumbling blocks when working with the PowerShell CIM CmdLets. The second problem, which was both pretty nasty as it basically prevented me from using the CIM CmdLets properly for SCCM and pretty time consuming, as it was hard...

In my last post, I explained a bit, why I changed over to the “new” PowerShell CIM CmdLets. However as mentioned, there were a few painpoints that I struggled with. The Problem One of them was to work with embedded classes. These are classes that are “embedded” into other classes....

Some time ago I moved most of my WMI related work from the “deprecated” PowerShell WMI CmdLets (Get-WMIObject, Invoke-WMIMethod, etc.) over to the “new” CIM CmdLets (Get-CimInstance, Invoke-CimMethod, etc …). It wasn’t really because they are “deprecated”. Microsoft might treat them this way, but they will for sure be around...

The Problem Organizing code in modules and re-using the same functions in different scripts is a common and recommended practice when working with PowerShell. I do have a lot of different modules created and grown over time that cover different aspects and that I use regularly in my daily work....

I’m currently updating/rewriting a whole slew of PowerShell scripts that I have created over the last couple years into something less “hacky”. As scripts grow larger they become harder to read or understand the logic. A typical and recommended approach is to break it up and separate certain functionality or...