6 ms·
I keep on seeing all this talk about Powershell, and it's inspiring me to maybe learn some, although I've already commenced pursuit of skill in bash and python
by thomasjb 3y ago
I keep on seeing all this talk about Powershell, and it's inspiring me to maybe learn some, although I've already commenced pursuit of skill in bash and python
- causality0 3y agoTelling ChatGPT to write you a powershell script and then explain what every part of it does makes learning it really fast. It's super handy. Powershell scripts have solved so many time consuming problems for me, like having one-click shortcuts for changing my desktop resolution or fixing all the file names in a 20TB media archive.
- newprint 3y agoAfter 3 decades working on Windows, I recently got into Linux and stared learning bash through "The Linux Command Line, 5th ed." book and watching youtube videos. Powershell is so much nicer and a lot more productive to work with compared to bash. Unlike the bash commands that returns strings, Powershell commands return objects. Working in any OOP language and Powershell feels very natural.
- cyberbanjo 3y agoJust to corroborate from the opposite direction, I have run exclusively Linux on my personal machines for nearly a decade, and I started a new job where I get to use PowerShell, and it's really amazing, the amount of grep/tail/head (or Get-ChildItem/Select -First/-Last) I have to do is so much less, it feels so much less klunky. Probably the only thing I don't like more so far is Get-Help, because it doesnt put you into a pager with search, it just dumps to text. EDIT: apparently I need Help not Get-Help for paging EDIT2: and I hate that PowerShell doesn't support readline/emacs keybindings
- peteri 3y agoI thought the PSReadline module had some of that but then it might be a "nearly" compatible experience which can be really jarring when you hit the edge cases.
- cyberbanjo 3y agoMaybe I just didn't have enabled, thanks for reminding me, seems good enough for me
- 0x445442 3y agoWhat’s the dirs -v, pushd and popd equivalent in PS?
- shortrounddev 3y agoWhat do those do
- metaltyphoon 3y agoKeep a stack of dirs where u can jump very quickly into.
- cyberbanjo 3y agopopd and pushd are aliases for Pop-Location and Push-Location, so they are the PowerShell equivalent. Unsure about dir -v. dir itself is an alias for Get-ChildItem, but I don't know about -v (natural sort of version number)
- 0x445442 3y agodirs -v presents a numbered stack of directories. Pushd doesn’t just function on one directory but also takes in a number pointing to a directory on the stack. Nothing like this exists out of the box for PS and it’s one of the most productive features in Bash.