Skip to content

PowerShell script to create deployments for multiple software update groups to multiple collections

Featured Replies

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

Try this line to set the PS Drive.

Set-Location "$($SiteCode.Name):" -ErrorAction Stop

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.