Stupid Powershell Tricks
I have recently been using Windows 11 Powershell more because of how awful the windows file explorer is. Even doing something simple like going to your home directory from the task bar it not easy. Everything is extra multi level navigation or extra clicks. I have resorted to navigating the filesystem inside of Powershell. Powershell at least starts you off in your own home directory instead of an ever changing list of recent files or a quick access list I have to manage separately.
List directories with dir | fw
Listing directories with simply typing dir or ls works fine when you have a few files, however when your list of files gets too long it goes way up off the screen in a single column. In the old command line of dos there was the /w switch that would print wide. I found you can pipe the output of the dir command to Format-Wide or the alias of a simple "fw" so dir | fw is a quick way to print a wide directory listing.Execute Applications and Open Files with ii
The ii command is an alias of Invoke-Item, this will open a file with the default application for that item or run an application. I am finding this easier to navigate and open files with this when I have been navigating around the file system with powershell.
Search strings in files with findstr "<string>" *
Findstr is an old command from Windows 2000, however I did not use the Windows 2000 command line too much and was not familar with it as much as linux, mac and unix command lines. This works like the grep command to find strings in your files, so you can search for that string in all the files in a directory with findstr "<search string>" *Parts of microsoft are moving windows to be more and more like Unix with Coreutils and embracing linux with Azure Linux maybe they will eventually bring back the proper home directory concept.