Google, shown on the screen of a laptop. A man wearing a watch. There is an iPhone on the table.
Google, shown on the screen of a laptop. A man wearing a watch. There is an iPhone on the table.
I couldn’t find a clear answer to this on Google — let’s hope you can now!

A simple request, to POST data (in this case, a .csv) to an API endpoint; how hard can it be right?

Well, after scouring StackOverflow, Reddit, PowerShellBros and many other great, go-to sources of mine — I was stuck. Yes, there are functions that suffice the upload of some content to API endpoints, but nothing for my use case.

I was almost ready to throw in the towel and use cURL (which is native to Windows 10) when I read over the Invoke-RestMethod documentation once more. In PowerShell 6.10, the -Form parameter was introduced. …


A blank, white billboard on the side of a deserted highway with some dry rocks and sun damaged grass.
A blank, white billboard on the side of a deserted highway with some dry rocks and sun damaged grass.
Your template is your blank canvas. Now fill it in and deploy those resources!

There are many reasons an ARM (Azure Resource Manager) template is useful. For me, it’s about producing Repeatable Results. Business is driven by producing consistent, repeatable results. Where would we be without templates? Take a look around you, the chair your sitting on right now was likely created using die casts, the glass you drink from made using molds — everything is made using some kind of template. That’s what an ARM template is. It’s Azure’s very own answer to the die cast.

So what can we actually do with these templates? Looking at the Azure Quickstart Templates is a sure fire way to see just how limitless the potential of these are. For me, I’ve used them recently to simplify the deployment of new DNS Zones. …


Picture of a macbook air with Visual Studio Code (VSCode) in the background showing script being written. Commes Des Garcons.
Picture of a macbook air with Visual Studio Code (VSCode) in the background showing script being written. Commes Des Garcons.
The more you can learn about PowerShell the better.

After receiving a surprisingly positive response (thank you!) to my first PowerShell tips article — Level Up your Powershell with five tips in five minutes!, I’ve decided to release another short article with five more. If you haven’t read my first article, be sure to check it out.

  1. Use splatting to de-spaghettify your code!
    Splatting is a great way to transform potentially messy or long lines of code into a beautiful easy to read format. How does it work? PowerShell associates each value in the collection you specify with a valid command parameter. Splatting variables are just like standard variables, except that they begin with an At @ instead of a dollar sign $. …

Picture of binary in the shape of a love heart to play on my love of PowerShell and code.
Picture of binary in the shape of a love heart to play on my love of PowerShell and code.
I love PowerShell and so should you!

As engineers, we’re fortunate enough to have the most diverse tool in Microsoft administration right at our fingertips. With these 5 tips, you’ll start to understand just how easily you can leverage PowerShell to your advantage in your daily operations.

  1. Use pipeline inputs
    Something I did too often when I first started learning PowerShell was casting everything and anything as a variable only to use it once in the very next line. Why do that, when you can simply pass the output down the pipeline into your next command?

Instead of a convoluted and messy block of code as below:

$files = Get-ChildItem -Path C:\Temp\* -Include *.txt …

Image for post
Image for post
The simplest solution is often the best one.

Picture this, you wake up Monday morning — primed and ready for another week of work. You login, warm cup of coffee by your side and find that nothing is working. You can’t access your client database, or your website. Instead of being met with a productive day, you’re met with a popup telling you to fork over $10,000 in BTC or you can say goodbye to months, even years of work.

Enter Ransomware, this nasty little piece of software is commonly used to encrypt files with an indecipherable password. Unfortunately for you, once you’ve fallen victim to this attack, it’s too late. …

About

Nathan Magyar

A Systems Engineer with a passion for all things PowerShell based in Melbourne, Australia. https://www.linkedin.com/in/nathanmagyar/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store