A cmdlet around the endpoint, or a cmdlet per method? Disclaimer: every REST API works different, so this script should be an example of how you can build a function for each REST API. Nowadays there are more and more Rest APIs that we can use instead of Cmdlets (which use the Rest API in … Continue reading How to manage most Rest APIs with just a few PowerShell functions
Tag: PowerShell
How to stringify nested Json in PowerShell and back to a PSObject
Stringify dynamic child properties in Json with PowerShell I had a fun one yesterday that I want to share here. We have a database at work (new job at InSpark), in the database we have a table in which we can create a row ourselves by making a request via a put method. The row … Continue reading How to stringify nested Json in PowerShell and back to a PSObject
FIX: (Re-)install the Windows Snipping Tool
What if the Snipping Tool doesn’t work or start anymore? I mostly use Greenshot, but sometimes it’s not the best tool for capturing certain elements. That’s when I rely on the Snipping Tool. But what if the built-in Snipping Tool in Windows stops working? Below are some steps you can try to fix it. Install … Continue reading FIX: (Re-)install the Windows Snipping Tool
FIX: error: cannot stat ‘…example.json’: Filename too long
Filenames too long in a main repository that you cannot update directly? So, I ran in this issue when I tried to pull a new branch and tried to merge main into it. I had a list of files where the filename were too long, so I won’t share all of them with you, but … Continue reading FIX: error: cannot stat ‘…example.json’: Filename too long
FIX: The following untracked working tree files would be overwritten by checkout GIT
Untracked files when switching branches? So, you’re trying to switch branches with Git, and you run into this error: This situation typically arises in a few scenarios: So, what untracked files is Git talking about? Before going we’ll fix this, let’s check what Git means. You can open Git Bash, PowerShell, or whatever IDE you’re … Continue reading FIX: The following untracked working tree files would be overwritten by checkout GIT
FIX: GitHub Actions – Unable to process file command ‘output’ successfully JSON
How to add Json to GitHub actions output I had a fun one today at work. I am fairly new with GitHub workflows & actions. The best part about it is that I can use PowerShell for most actions. In one of the GitHub actions, I need to output the customerConfig to GitHub output as … Continue reading FIX: GitHub Actions – Unable to process file command ‘output’ successfully JSON
FIX: Cannot find built-in module that is compatible with the edition
Microsoft.PowerShell.Utility & Microsoft.PowerShell.Management Cannot find the built-in module that is compatible with the edition. Please make sure the PowerShell built-in modules are available. They usually come with the PowerShell package under the $PSHOME module path, and are required for PowerShell to function properly. If you made this error, you screwed up big time.But luckily, it’s … Continue reading FIX: Cannot find built-in module that is compatible with the edition
How to create a maintenance mode in Azure Automation
An emergency button to ensure that your runbooks stop running without disconnecting the schedule in Azure Automation Disclaimer: This post can be seen as satire. There are probably better ways, but because we were so limited with the customer at the time, we opted for a hobby approach: ‘Maintenance mode the creative way‘. What if… … Continue reading How to create a maintenance mode in Azure Automation
FIX: Get-AzContext missing ‘subscription’ Az.Accounts PowerShell
Get-AzContext missing a ‘subscription’ while using Set-AzContext We use the command below as standard in our scripts, but I have also discovered that this is not entirely useful. But for more about that you should go to another section on this blog (see the Table of Contents). You probably found this blog cause of an … Continue reading FIX: Get-AzContext missing ‘subscription’ Az.Accounts PowerShell
How to import PowerShell 7 runbooks in Azure Automation
Import a PowerShell 7.XX runbook in Azure Automation via PowerShell You cannot currently choose PowerShell 7.XX runtime via the standard cmdlet New-AzAutomationRunbook in the Az.Automation module. This limits you to using the Azure portal. You can upload runbooks via a workaround with runtime 7.XX. This only applies to powershell script files located in an Azure … Continue reading How to import PowerShell 7 runbooks in Azure Automation