PowerShell tags
Some cool tricks with your Windows Shells
I’ve been getting more and more back to the command line, doing more with PowerShell and even Bash scripting on Docker and WSL (Windows Subsystem for Linux). There are a few of the tricks I have learned recently that help me every day. F8 searches history! That’s right! When you type into the command line …
A PowerShell Watch Command
I use dotnet-watch a bunch and have used a version via grunt/gulp a little in the past as well. In front of me, I had some TypeScript, tsc and an app.ts file. I wanted to watch it and trigger tsc automatically. But there was no csproj, no NuGet, and no npm in sight. I went searching far and wide for solutions, and some …
Form posts with PowerShell
This article is based on an answer found and updated on StackOverflow. I’f you have used PowerShell for much at all, you are probably familiar with Invoke-WebRequest. But did you know you can carry around a session and have it automatically add and update cookies for you? The Scenario I had an API I wanted to …
Treat Warnings As Errors with this one weird PowerShell Script...
There is this great feature in Visual Studio that lets you really dial up the quality of your code. It has been there forever it seems, but very few people use it. The compiler spits out errors, which stop your app compiling. You fix your errors and move on. But the compiler also spits out a lot of warnings too. And …
Make me a sandwich
A lesson in powershell. I typed this: > iisreset Which responded with this: Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the remote computer or to the domain administrator global group. So I typed this: > …
Aliasing your 'git status'
Anyone else have the bad habit of typing in git statsu or git stauts? Or maybe you just end up typing git status all the time at the command line, and wonder if there was a better way. Well, there is. Aliases Most command-line shells have the concept of aliasing. This means you type one thing, and it represents an …
Visual Studio PowerShell
I’ve been using psake as my build tool and running my builds on Appveyor. Now Appveyor runs with all the visual studio commands available on the path. When you install visual studio, It gives you a special cmd shell shortcut that loads you an environment with all the visual studio stuff available, which is cool. …