Hi.. I don't know what happened but I was using this script for months.. Recently upgraded to 1806, not sure if that's when it broke or not.. But now I get the following when I run it..
PS C:\Windows\system32> C:\Scripts\Create SUDG\Create_SoftwareUpdateDeploymentgroups.ps1
[ERROR] SCCM Module couldn't be loaded. Script will stop!
PS C:\Windows\system32> import-module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1)
PS C:\Windows\system32> $SiteCode=Get-PSDrive -PSProvider CMSITE
PS C:\Windows\system32> cd ((Get-PSDrive -PSProvider CMSite).Name + ':')
Set-Location : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Path'. Specified method is not supported.
At line:1 char:4
+ cd ((Get-PSDrive -PSProvider CMSite).Name + ':')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.SetLocationCommand
Any ideas? Thanks