Parse env:Path with PowerShell

wp-read-more-redirectwp-read-more-redirectNo Gravatar

The environment variable PATH (combined SYSTEM PATH and USER PATH) can be tricky to parse if you want to check for each folder it contains.  This is due to the support of various formatting styles.  For example, this is a valid PATH statement:

Notice the differences

  • Folder with spaces
  • Folder without spaces
  • Folder with an ending backslash (\)
  • Folder without an ending backslash (\)
  • Folder with a semicolon in the middle
  • Folder with a semicolon at the end
  • Blank folder (;;)

A few references can be found…

But, I could find no simple method to parse this complexity so I wrote a PowerShell Function to handle it.

continue reading on CatapultSystems.com

January 30, 2018

Posted In: Scripting

Tags: ,

GitHub embedding

wp-read-more-redirectwp-read-more-redirectNo Gravatar

This is an example of embedding a GitHub repository script in WordPress using the WP-GitHub plugin (with customized prism.js to add PowerShell, Batch, SQL and AutoIt language support)

And an example of a custom plugin (not yet published) with shortcode: Read More Redirect
continue reading on CatapultSystems.com

January 5, 2017

Posted In: Scripting

Tags: ,

ConfigMgr and SQL – NTFS allocation unit size

No Gravatar

It’s been many years since I read that SQL databases should use an NTFS volume formatted with at 64KB file allocation unit size (block size). So long that I didn’t remember why or if it is still considered best/good practice. It appears that it is according to Microsoft and the foremost authority on SQL with ConfigMgr.

keep reading at http://blogs.catapultsystems.com/chsimmons/archive/2016/12/23/configmgr-and-sql-ntfs-allocation-unit-size

December 23, 2016

Posted In: ConfigMgr, Scripting, T-SQL

ConfigMgr Content Source Path migration

No Gravatar

Several ConfigMgr scenarios require that the content Source Path be changed.  This typically includes migrating to a new ConfigMgr environment (2007 to 2012, 2012 to Current Branch, etc.), and simply moving the source content to a new location such as a DFS Share or low-speed NAS device.

Updating the Source Path can be done manually via the ConfigMgr console.  For Packages, Software Update Deployment Packages, Drivers, Driver Packages, Operating System Images, Operating System Upgrade Packages, Boot Images, and Virtual Hard Disks, just add the Pkg Source Path or Package Source Path column to the console view to review the paths, then edit the object’s Source Folder in the Data Source tab.

However, for Applications, you’ll have to step through each Deployment Type on each Application, view the properties and modify the Content Location in the Content tab.

This is all painfully slow if you have more then a handful to deal with.  So, automate it!

image image

The community has developed at least 5 solutions to this including

CoreTech and Nickalaj have the slickest solutions.  Sometimes a GUI gives the visual feedback you need to be confident in the final outcome.

158_1 image

Either of these two tools should effectively handle the changes.  As a bonus, both will actually copy the content files from the old to the new path.  Awesome!

Happy migrating!

September 28, 2016

Posted In: ConfigMgr, Scripting

Tags: