Closed pveller closed 9 years ago
Hi Pavel,
Thanks for the kind words. I'm reading your blog quite religiously and admire your input to the community so It means a lot to me that you're using it!
So the problems is that the cmdlet is really not our cmdlet but rather PowerShell's itself and it works with whatever provider/drive the runspace has currently specified as its location, e.g. The -ID has no meaning in context of regular file system, that is why you need to provide a context. in general I just use a dot to say that I want it to use the "current provider", like:
Get-Item . -ID "{GUID}"
In a smilar vein you can avoid it looking bad simply by stating your purpose explicitly and providing a database like:
Get-Item master:\ -ID "{GUID}"
Oh, now it makes perfect sense. Thank you Adam!
p.s. I hope to see you on the SUGCON NA. We ought to do some behind the scenes geekout on ZenGarden vs. (or is it "plus" ?) SCORE :)
Definitely! Looking forward to it!
Hey Guys,
Love SPE! All kinds of item manipulations in bulk and import / transformations are sooooo much easier to build. Very "fluid".
I was scripting something today and I needed a Get-Item by ID. I figured I could do something like:
It works but it's a little ugly. The
Get-Item
wouldn't run without a-Path
and wouldn't accept an empty string as a value. I think a version that just accepts theID
orUri
withoutPath
is warranted. Let me know what you think!