Powershell on Linux and Ubuntu Bash on Windows

Hamish McPanji

Honorary Master
Joined
Oct 29, 2009
Messages
42,084
The advent of Windows 10 anniversary edition heralded the much lauded introduction of Bash on Windows. I have used it extensively the last few days, and am loving it.

A friend of mine is a windows powershell expert , and we often spend our free time discussing transformation of data , business rules and intelligence and other riveting and exciting stuff like that. The problem is, when it comes to detail, we are often speaking a different language.

In August 2016, Microsoft announced the introduction of Powershell on Linux (alpha,I think). I haven't played with it or even looked at it, bit it looks like an interesting project as well, and in theory will allow me to play with some of the cool powershell stuff on my Linux servers

Has anyone played around with these 2 interesting cross platform scripting options?

Please share your experiences here (for my benefit, of course )
 

Hamish McPanji

Honorary Master
Joined
Oct 29, 2009
Messages
42,084
Quick tip:. Ubuntu on Windows

To access your Linux folder from windows :
Browse to the Appdata\local\lxss folder under your username , or on command prompt:

cd /users/%username%/Appdata/Local/lxss

Under that directory you will find your root user folder (/root), and the Linux user folders (/home/username)

To access your windows drivers in the bash command line:
cd /mnt
You will find your drive letters there
 
Last edited:

_kabal_

Executive Member
Joined
Oct 24, 2005
Messages
5,922
Apparently you should never write to the lxss directory and subdirectories in windows
 

Hamish McPanji

Honorary Master
Joined
Oct 29, 2009
Messages
42,084
Apparently you should never write to the lxss directory and subdirectories in windows
Why is that though? I genuinely don't know even though I tried it already. The files don't actually appear in the Linux, even though you can see them in windows I put it down to some sort of permissions thing . But was not sure why.

However , when I create a file in Linux, and edit the file, I have no problem. Strange but true
 

stricken

Expert Member
Joined
Sep 5, 2010
Messages
2,265
Windows has no concept of Linux file metadata / permissions hence the warning to not alter Linux subsystem files from Windows.
 

Hamish McPanji

Honorary Master
Joined
Oct 29, 2009
Messages
42,084
[)roi(];18741090 said:
You're muddling the two. Benefit for Windows is obvious, for Linux not so
If it remains a static project, then yes it's usefulness is limited.

But if there is a fast development path for this project then it's usefulness to script fogeys like me will mean we will be able to use the same/similar syntax to script on both platforms.

In the telemetry data project, for example. I was able to do my transforms and filter the data with a fraction of the coding required on php as the built in objects were a lot better
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
6,282
If it remains a static project, then yes it's usefulness is limited.

But if there is a fast development path for this project then it's usefulness to script fogeys like me will mean we will be able to use the same/similar syntax to script on both platforms.

In the telemetry data project, for example. I was able to do my transforms and filter the data with a fraction of the coding required on php as the built in objects were a lot better
Consider this:
Almost nobody writes scripts in PHP (or Powershell) on *nix. Going to be hard to dent the current entrenchment of e.g. Python & Ruby. What problem are they trying to fix? Python and Ruby (as example) certainly aren't inferior to Powershell? Plus both of these work on Windows so why would someone not choose to go the other way: Python / Ruby / ... on Windows.

Consider stackoverflow alone; how much help could you expect to get with Powershell scripts on *nix?
 

kripstoe

Expert Member
Joined
Sep 15, 2012
Messages
3,820
[)roi(];18741090 said:
You're muddling the two. Benefit for Windows is obvious, for Linux not so

If you're familiar with Windows and PowerShell, and implementing... let's say a .NET Core solution on Linux. Why would not not give someone a tool they're familiar with?
 

Hamish McPanji

Honorary Master
Joined
Oct 29, 2009
Messages
42,084
[)roi(];18741454 said:
Consider this:
Almost nobody writes scripts in PHP (or Powershell) on *nix. Going to be hard to dent the current entrenchment of e.g. Python & Ruby. What problem are they trying to fix? Python and Ruby (as example) certainly aren't inferior to Powershell? Plus both of these work on Windows so why would someone not choose to go the other way: Python / Ruby / ... on Windows.

Consider stackoverflow alone; how much help could you expect to get with Powershell scripts on *nix?
Because they are used to powershell and Windows. They can continue as is on Linux or osx
 

Arthur

Honorary Master
Joined
Aug 7, 2003
Messages
26,879
By the way, if you're interested in why and where Msft is taking Bash on Windows, take a listen to Microsoft's Bash boss Rich Turner explaining things in this week's WW on TWiT.

Lots of interesting tidbits and insights into what Msft is doing with WSL and Bash on Win.


Rich Turner starts at 1:00:00:30.
 
Last edited:
Top