10-01-2010
Downloads: 307
File size: 414 B
Views: 1,422
Embed
 |
Show-Properties |
- function Show-Properties {
- param(
- [Parameter(ValueFromPipelineByPropertyName=$true)]
- [Alias('LinkPath')]
- [Alias('FileName')]
-
- $Path
- )
- begin {
- $shell = New-Object -ComObject Shell.Application
- }
-
- process {
- $parent = Split-Path $Path
- $child = Split-Path $Path -Leaf
-
- $folder = $shell.NameSpace($parent)
- $file = $folder.ParseName($child)
- $file.InvokeVerb('Properties')
- }
- }
Opens the property page for any file specified. Sample for a pipeline-aware function (filter)