Remove-MSModuleAttachment

Remove an attachment linked to an App,User,Device etc.

Syntax


Remove-MSModuleAttachment -Module (String) -Id (Int32) [-AttachmentId (Int32)]

Examples


## Remove attachment with Id of 10 from UserMigration record with Id 15000
Remove-MSModuleAttachment -Module UserMigrations -Id 15000 -AttachmentId 10

## Remove ALL attachments from Application with AppId 3079 which have a display name similar to 'AutoUpdater.ps1'
Get-MSModuleAttachments -Module Applications -Id 3079 | Where-Object { $_.DisplayName -like "AutoUpdater.ps1*"} | ForEach-Object {Remove-MSModuleAttachment -Module Applications -Id 3079 -AttachmentId $_.AttachmentId}