irelephant [he/him]🍭
- 7 Posts
- 104 Comments
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
1·6 months agoI mean running it directly shows up in the ugly blue window, and that’s slower in my experience.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
2·6 months agoThe aliases are good for the most part, but
curlis an alias forInvoke-Webrequest, even though the two are incompatible.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
11·6 months agoBut on windows it makes sense to have the stuff built in, because those utilities are not on windows.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
1·6 months agoThe blue powershell window is for me, but running powershell.exe in conhost, or windows terminal is fast enough.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
31·6 months agoI hate to say it, but powershell is better than bash.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
12·6 months agoAs much as I hate windows powershell is actually decent.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
1·6 months agoI started with (in order, give or take one or two): python, javascript, lua, c, bash, powershell
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
1·6 months agoI wouldn’t call it confusion, more just ick. I don’t really like it.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
1·6 months agoI know, but not all languages require it.
For example, lua does the following:
if true then print("hello") end hellobut this also works:
if true then print("hello") hello
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
13·6 months agoAfter the if condition. No other language does that, so it feels unecessary.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
4·6 months agoDid you mean WSL? I mostly use it for that too because lua development on windows is ass.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
44·6 months agoI can do that as well:
$l = Get-Content "example.txt" -TotalCount 1; Write-Output $l; ($l.TrimEnd("`r", "`n")).LengthThere’s a condensed version using aliases then:
$l = gc 'example.txt' -TotalCount 1; $l; ($l.TrimEnd("`r", "`n")).LengthI still think it has a better syntax than bash.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
68·6 months agoMaybe you’re a bit more used to the linux stuff then.
https://lemm.ee/comment/20786033 – I think powershell’s syntax is far better than bash’s. It feels more modern.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
109·6 months agoIts a completely different shell, not just another terminal emulator.
Its more readable, and its syntax is less arcane than bash.
For example, a script to get the first line of a file and its lenght in bash is:
#!/bin/bash if [ "$#" -ne 1 ]; then echo "Usage: $0 filename" exit 1 fi filename="$1" if [ ! -r "$filename" ]; then echo "File '$filename' does not exist or is not readable." exit 1 fi read -r first_line < "$filename" echo "First line: $first_line" length=${#first_line} echo "Length of first line: $length"There is so much I hate about this, like using a semicolon after the if condition, and ending it in fi.
Versus the powershell version:
param ( [Parameter(Mandatory = $true)] [string]$FilePath ) if (-not (Test-Path -Path $FilePath)) { Write-Error "File '$FilePath' does not exist." exit 1 } try { $firstLine = Get-Content -Path $FilePath -TotalCount 1 } catch { Write-Error "Could not read from file '$FilePath'." exit 1 } Write-Output "First line: $firstLine" $lineLength = $firstLine.Length Write-Output "Length of first line: $lineLength"It feels more modern.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•Why Microsoft open sourced PowerShell and ported it to Linux
467·6 months agoPowershell is annoyingly good though.
This is where I got the term from: https://craphound.com/news/2023/09/17/plausible-sentence-generators/
Find and Replace?
Ai code is specifically annoying because it looks like it would work, but its just plausible bullshit.
irelephant [he/him]🍭@lemm.eeto
Linux@programming.dev•[Linux Experience Report as a Blind Person] I Want to Love Linux. It Doesn’t Love Me Back: Post 1 – Built for Control, But Not for People — fireborn
3·6 months agoWhile it has a smaller userbase, the nerds and linux users are more concentrated here, so there’s still a lot of people who can help.




As well as
exit!