Hello,
I am in an environment where we lock down the computers. Basically we provide icons to the user that we want them to have. One of the challenges moving from Windows XP and Windows 7 is the "recent documents." Windows XP we were able to get what we needed listed, but with Windows 7 the only way we can do that is by pinning the icons. Now this isnt feesable with 900 desktops being this way. I have figured out how to pin 1 item to the taskbar, I am assuming the startmenu isnt much different. What I cant figure out is how to get the contents of a folder into an array and have the names be passed to the code that is creating the pins.
btw I am just learning Powershell, so far really like the control it allows. Here is the code that I have so far. I am trying to get the contents of C:\Drivers\StartMenu put into an array so that it can be passed into the code to Pin the items.
$Shell = new-object -com "Shell.Application"
$folder = $shell.Namespace('C:\Windows')
$items = Get-ChildItem -Force C:\drivers\startmenu
Foreach($item in $items)
{
$a = $item.name
}
$verb = $Item.verbs() | ? {$_.Name -eq 'Pin to Tas&kbar'}
If ($verb) {$verb.DoIt()}I have tried moving $verb and the If into the {} but doesnt work.