A PowerShell module for removing iCloud Photos shortcuts from This PC and Quick access on Windows.
Each time iCloud for Windows is opened, updated, or installed, iCloud Photos shortcuts are automatically created under This PC and/or Quick access in File Explorer, with the former being impossible to remove interactively. This module allows programmatic removal of the shortcuts.
- *Windows with PowerShell.
*Quick access management is limited to Windows OS versions 10.0.10240 or higher.
First, ensure PSGallery
is registered as a PowerShell repository:
Register-PSRepository -Default -Verbose
To install the module:
# Latest, for the current user
Install-Module -Name Remove-iCloudPhotosShortcut -Repository PSGallery -Scope CurrentUser -Verbose
# Specific version, for the current user
Install-Module -Name Remove-iCloudPhotosShortcut -Repository PSGallery -RequiredVersion x.x.x -Scope CurrentUser -Verbose
# Latest, for all users
Install-Module -Name Remove-iCloudPhotosShortcut -Repository PSGallery -Scope AllUsers -Verbose
To remove the iCloud Photos Quick access shortcut:
Remove-iCloudPhotosQuickAccessShortcut -Verbose
To remove the iCloud Photos This PC shortcut (Requires elevation):
Remove-iCloudPhotosThisPCShortcut -Verbose
To list all available functions of the module:
Get-Command -Module Remove-iCloudPhotosShortcut
To list versions of the module on PSGallery
:
# Latest
Find-Module -Name Remove-iCloudPhotosShortcut -Repository PSGallery -Verbose
# All versions
Find-Module -Name Remove-iCloudPhotosShortcut -Repository PSGallery -AllVersions -Verbose
To update the module (Existing versions are left intact):
# Latest
Update-Module -Name Remove-iCloudPhotosShortcut -Verbose
# Specific version
Update-Module -Name Remove-iCloudPhotosShortcut -RequiredVersion x.x.x -Verbose
To uninstall the module:
# Latest
Uninstall-Module -Name Remove-iCloudPhotosShortcut -Verbose
# All versions
Uninstall-Module -Name Remove-iCloudPhotosShortcut -AllVersions -Verbose
# To uninstall all other versions other than x.x.x
Get-Module -Name Remove-iCloudPhotosShortcut -ListAvailable | ? { $_.Version -ne 'x.x.x' } | % { Uninstall-Module -Name $_.Name -RequiredVersion $_.Version -Verbose }
# Tip: Simulate uninstalls with -WhatIf
To get all registered PowerShell repositories:
Get-PSRepository -Verbose
To set the installation policy for the PSGallery
repository:
# PSGallery (trusted)
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose
# PSGallery (untrusted)
Set-PSRepository -Name PSGallery -InstallationPolicy Untrusted -Verbose
To import / re-import the module:
# Installed version
Import-Module -Name Remove-iCloudPhotosShortcut -Force -Verbose
# Project version
Import-Module .\src\Remove-iCloudPhotosShortcut\Remove-iCloudPhotosShortcut.psm1 -Force -Verbose
To remove imported functions of the module:
Remove-Module -Name Remove-iCloudPhotosShortcut -Verbose
To list imported versions of the module:
Get-Module -Name Remove-iCloudPhotosShortcut
To list all installed versions of the module available for import:
Get-Module -Name Remove-iCloudPhotosShortcut -ListAvailable -Verbose