Update-MSModuleItems

Update MS Apps,Users,Devices etc. This function update one or many whole objects at a time, or update lists of specific properties.

Syntax


Update-MSModuleItems -Module (String) -Updates (Array) [-MatchDropdownsById] [-BatchSize (Int32)]

Examples


## Update One
$oneApp = Get-MSModuleItems -Module Applications -Ids 1000
$oneApp.CustomProperty1 = "Green"
$oneApp.CustomInt1 = 99
$oneApp.IsCoreApp = $true
Update-MSApplications -Updates $oneApp

## Update Many
$manyUsers = Get-MSModuleItems -Module UserMigrations -All -Take 2
foreach($user in $manyUsers)
{        
    $user.CustomProperty1 = "Blue"
    $user.CustomInt1 = 99
}
Update-MSApplications -Updates $manyUsers

## Update via Hash
$updates = @()
$updates += @{ Id = 1002; CustomProperty1 = "Red"; CustomInt1 = 99 }
$updates += @{ Id = 1004; CustomProperty1 = "Green"; CustomInt1 = 66 }
Update-MSApplications -Updates $updates