counter customizable

Archive for the ‘PowerShell’ Category

PowerShell – Import Configuration Manager module (2015-10-13)

Here is a script to import the Configuration Manager module in PowerShell. The module will only be imported in not previously imported.

PowerShell simple trim after specific character (2015-10-9)

A example of a simple Trim in PowerShell after a specific character. This will trim after “ –“

Logging for PowerShell (2015-10-9)

Here is a simple function or logging in PowerShell   # Settings for logging $Logfile = "C:\Log\PowerShell-LogFile.log" Function Write-Log {    Param ([string]$logstring)    Add-content $Logfile -value $logstring }

Could not load file or assembly ‘System.Management.Automation (2010-7-25)

When creating a new Microsoft Deployment Task Sequence in Microsoft System Center Configuration Manager 2007 R2 SP2 that is running on a Windows Server 2008 or older, you can get the following.