January 17th, 2007

IPCONFIG/All

PowerShell Team
PowerShell Team

While using CMD.exe, I got into a number of bad habits. One of those is the habit of eliminating whitespace for various commands. The problem is that that causes problems with PowerShell. More precisely stated – it doesn’t work. Here is what you get:

PS> ipconfig/all
The term ‘ipconfig/all’ is not recognized as a cmdlet, function, operable p
rogram, or script file. Verify the term and try again.
At line:1 char:12
+ ipconfig/all <<<<
PS>

In PowerShell, you have to put a space to separate the command name and the parameter (.e.g. ipconfig /all )

I know that and yet time and time again, I type it incorrectly. It is just burned into my head. After having tried to reprogram my brain, I’ve finally given up, accepted my weaknesses and done the following:

PS> function ipconfig/all { ipconfig /all }
PS> ipconfig/all

Windows IP Configuration

Host Name . . . . . . . . . . . . : jpsdesk10
Primary Dns Suffix . . . . . . . : ntdev.corp.microsoft.com
..

I put this in my profile so it is always available. I’m still a flawed person, but now I’m a productive flawed person. J

Enjoy!

Jeffrey Snover [MSFT]
Windows PowerShell/Aspen Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell|
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.