I am trying to pin a program to the start menu in Windows 10
$shell = New-Object -ComObject "Shell.Application"
$Folder = $shell.NameSpace("C:\Test")
$exe = $Folder.ParseName("notepad.exe")
#$exe.Verbs()
$ItemVerbs = $exe.Verbs()
Foreach($ItemVerb in $ItemVerbs)
{
If($ItemVerb.Name.Replace("&","") -match "Pin to Start")
{
$ItemVerb.DoIt()
Write-Host "Pin to the Start menu sucessfully.+ ""$ItermVerbTxt"" " -ForegroundColor Green
}
}
After executing this code, i see the success message which means it is finding the required verb.
But i DONT see notepad.exe tile in Start Menu.
Please help