Python Forum
Windows/Power Shell: Differences from the tutorial...
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows/Power Shell: Differences from the tutorial...
#3
(Oct-07-2016, 02:54 PM)wavic Wrote: I am not sure if this is PowerShell or just cmd.

Actually it's both, kind of. mkdir (or md) when used in powershell calls on PS's 'New-Item' cmdlet. The -p switch only exists in the unix/linux world, not DOS/Windows. So when PS parses the command, it ignores the '-p'. In cmd.exe the function mkdir does not ignore it, it fact it assumes it is another argument, "mkdir -p i/like/icecream" will actually create a directory "-p" as well as the directory tree "i/like/icecream". As you can imagine, there are heated debates on both sides on whether or not to use DOS commands or strictly cmdlets in powershell.

So my answer to the question, in the short term, use the mkdir or md in powershell, you're not going to break anything. In the big picture though, using DOS commands may end up in naming conflicts with PS, causing unexpected results. If you are planning on using powershell, then I would suggest learning powershell.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
RE: Windows/Power Shell: Differences from the tutorial... - by sparkz_alot - Oct-07-2016, 08:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Huge black friday power supply sale at EVGA Larz60+ 0 2,114 Nov-21-2018, 08:06 PM
Last Post: Larz60+
  differences between py2 and py3 Skaperen 4 4,426 Feb-10-2018, 09:16 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020