How can I get a full list of values for the -ItemType parameter in New-Item?
I realize that directory and file are acceptable values for the filesystem provider. But where in the help can I confirm this information? Or what command can I run to show it.
Hey Greg,
That’s a good question, i’m not too sure about how to automatically/quickly get a list of values for a parameter. But in this case, its a short list so tabbing through works ok.
File
Directory
SymbolicLink - I think this is V 5 only
Junction
HardLink
I’d be interested to know if there was an easy way to pull this from powershell though.
The thing is that New-Item is largely dynamic. What values are valid depends on the PSDrive you’re in at the time. So there’s no static enumeration. The command does expose tab completion, but it’s dependent on the PSProvider providing the valid values. Some will, some won’t.