Running PowerShell on Linux
Mostly, PowerShell works exactly the same on Linux as it does on Windows, but obviously, there are some differences between the two underlying operating systems that we need to be aware of and subsequently understand how PowerShell handles them.
Case sensitivity is the obvious one; while get-content
works as well as Get-Content
on Linux, get-content ./myfile.txt
doesn’t work if the file is called MyFile.txt
; see the following screenshot:
Figure 14.8 – The importance of capitalization
As you can see, if the capitalization of the path or filename is incorrect, then PowerShell can’t find the file. The best way I have found to compensate for this is to use tab completion as much as possible, as tab completion ignores capitalization, so typing myfi
and pressing Tab will find a file called MyFile.txt
.
The filesystems are different, also. Linux doesn’t use letters to distinguish drives and uses forward...