Bonjour,

A l'aide du code suivant, je n'arrive pas à déplingler (par exemple) le raccourci "Calculatrice" dans la barre de tâches W7.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$chemin = $Env:APPDATA+"\Microsoft\Internet Explorer\Quick Launch\User Pinned"

Function UnpinFromTaskbar ($AppName,$PinnedApp,$App) {
	Write-Host "Unpin '"$AppName"' from TaskBar..... " -NoNewline
	If ((Test-Path $PinnedApp) -eq $true) {
		$AppSplit = $App.split("\")
		$AppSplitCount = $AppSplit.Count
		$Filename = $AppSplit[$AppSplitCount-1]
		$DirectoryPath = $App.Trim($Filename)
		$DirectoryPath = $DirectoryPath.Trim("\")
		$sa = New-Object -com Shell.Application
		$pn = $sa.NameSpace($DirectoryPath).ParseName($Filename)
		$pn.invokeverb('taskbarunpin')
		If ((Test-Path $PinnedApp) -eq $false) {
			Write-Host "Success" -ForegroundColor Yellow
		} else {
			Write-Host "Failed" -ForegroundColor Red
		}
	} else {
		Write-Host "Already Removed" -ForegroundColor Yellow
	}
}
UnpinFromTaskbar "Calculatrice" $chemin"\TaskBar\Calculatrice.lnk" "C:\Windows\system32\calc.exe"
Quelqu'un pourrait-il me dire ce qui cloche ?
Merci d'avance !