Remove-IMLibrary
SYNOPSIS
Removes an Immich library and all associated assets.
SYNTAX
Remove-IMLibrary [[-Session] <ImmichSession>] [-id] <String[]> [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]
DESCRIPTION
The Remove-IMLibrary function permanently deletes an Immich library along with all its associated assets, metadata, and configuration settings. This is a destructive operation that cannot be undone, so it should be used with caution.
The function supports pipeline input for batch operations and includes confirmation prompts to help prevent accidental deletions. When a library is removed, all assets within that library are also deleted from the Immich database, though the original files on the file system remain unchanged.
EXAMPLES
EXAMPLE 1
Remove-IMLibrary -Id 'bf973405-3f2a-48d2-a687-2ed4167164be'
Removes the library with the specified ID after confirmation prompt.
EXAMPLE 2
Remove-IMLibrary -Id 'bf973405-3f2a-48d2-a687-2ed4167164be' -Confirm:$false
Removes the library without prompting for confirmation (use with extreme caution).
EXAMPLE 3
Get-IMLibrary | Where-Object Name -like '*test*' | Remove-IMLibrary
Removes all libraries with 'test' in their name using pipeline processing.
EXAMPLE 4
$librariesToRemove = @('bf973405-3f2a-48d2-a687-2ed4167164be', '9c4e0006-3a2b-4967-94b6-7e8bb8490a12')
$librariesToRemove | Remove-IMLibrary -WhatIf
Shows what would happen if the specified libraries were removed, without actually deleting them.
PARAMETERS
-Session
Optionally define a immich session object to use. This is useful when you are connected to more than one immich instance.
-Session $Session
Type: ImmichSession
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-id
Specifies the unique identifier(s) of the library to remove. Must be valid GUID format. Accepts pipeline input by value and by property name for batch deletion operations. This parameter has an alias 'libraryId' for compatibility.
Type: String[]
Parameter Sets: (All)
Aliases: libraryId
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
This function supports ShouldProcess for confirmation prompts. Use -WhatIf to preview changes and -Confirm to control confirmation behavior. Library removal is permanent and affects all assets within the library - ensure you have backups before proceeding.
RELATED LINKS
EDIT THIS DOC
This page was auto-generated from the powershell command comment based help. To edit the content of this page, update the script file comment based help on github Github