Given the group information shown below. How can I pin to a specific group (row and column as well) using powershell?
<start:Group Name="Create"> <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="microsoft.windowscommunicationsapps_8wekyb3d8bbwe!Microsoft.WindowsLive.Calendar" />
Here is the base code im using
function Pin-App { param( [string]$appname, [switch]$unpin ) try{ if ($unpin.IsPresent){ ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from Start'} | %{$_.DoIt()} return "App '$appname' unpinned from Start" }else{ ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Pin to Start'} | %{$_.DoIt()} return "App '$appname' pinned to Start" } }catch{ Write-Error "Error Pinning/Unpinning App! (App-Name correct?)" } }
1 Answers
Answers 1
You can't.
Instead of asking so many questions about little bits of a bad solution for your problem, why not ask your real question?
If you want to know what apps are pinned to your Start Menu you might go ahead and export the Start Menu Layout xml. Here you will see an entry shown in the question that gives an AUMID of the pinned item. I want to pin my pinned shortcuts from one computer to another computer.
That's what you said.
Instead of asking at least four questions1 about your strange approach at solving this problem just ask your real question and get a real answer:
Just like you used Export-StartLayout
to get the layout XML from one computer use Import-StartLayout
to set the start layout from the XML on the other computer.
1 (1) Parse Xml For Nodes Within Nodes C# (2) Convert AUMID to Application Name C# (3) Pin To Start In Proper Group Powershell (this one), and (4) Pinning To Start Items In AppData Folder
0 comments:
Post a Comment