# Refresh icons by calling the WinAPI function: # SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); # [ClearIconCache.ps1] # Load the necessary assembly with the SHChangeNotify function Add-Type @" using System; using System.Runtime.InteropServices; public class Shell32 { [DllImport("shell32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern void SHChangeNotify(int wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2); } "@ # Define constants $SHCNE_ASSOCCHANGED = 0x08000000 $SHCNF_IDLIST = 0x0000 # Call the SHChangeNotify function [Shell32]::SHChangeNotify($SHCNE_ASSOCCHANGED, $SHCNF_IDLIST, [IntPtr]::Zero, [IntPtr]::Zero) #source https://www.reddit.com/r/Windows10TechSupport/comments/174jl5l/comment/k72b2p2/