Alias for PsIsContainer?

Question:

Instead of typing PsIsContainer, I would like to be able to use either “dir” or “folder” strings. Is there a way in PowerShell that allows me to substitute one string for another, as in this case?

Answer:

I think you could get close to what you’re afer by predefining a couple of scriptblocks e.g.:


Good news in PowerShell V3. This is supported natively e.g.:

Source:

Alias for PsIsContainer? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply