Azure DevOps CI/CD Pipeline, PowerShell & PSScriptAnalyzer

**In my last blog post, I introduced you to the solution I’m using on Office 365 to create personal e-mail addresses. This solution is hosted on Azure DevOps and is automatically released to the PowerShell Gallery. In this blog post, I will explain briefly how this works.** The Azure DevOps project is hosted in a public repository. This was introduced recently and enables other users of the module to contribute to the project. I started with an empty repository and created a new branch to upload the PowerShell module & manifest file to the repository. ...

20-05-2019 · 2 min · Jean-Paul van Ravensberg

My Office 365 based personal, secure & unique email system

A secure email system is important to protect yourself from the increasing phishing and spam attacks, where hackers try to steal money on a large scale. More and more organizations hosting personal data are getting hacked, where hackers misuse this personal data to launch attacks. In this blog post I will introduce you to a solution I’ve created based on Office 365 and PowerShell to prevent that my email address is spread more widely on the internet. ...

19-05-2019 · 5 min · Jean-Paul van Ravensberg

Use PowerShell in Azure Functions [Preview]

**Microsoft recently announced the Public Preview of the ability to run PowerShell code in an Azure Function. This means that the PowerShell code will run in a Platform-as-a-Service solution, completely serverless! You pay only for the time that you use the solution and you don’t have to manage the underlying infrastructure! In this blog post, I will show a practical example of how to use an Azure Function in combination with an Azure Logic App.** After publishing a blog post, I always want to share the post as quickly as possible on Twitter & LinkedIn. ...

14-05-2019 · 3 min · Jean-Paul van Ravensberg

Use PowerShell DSC and Azure Automation to Create an Active Directory Domain

Because of the recent domain change of my blog, I decided to completely start over again with my lab in Azure. I’ve been working with Desired State Configuration Configs in Azure for quite a few years, but never used them for my own lab environment. It felt a bit overkill to do that, but now I wanted to start over and do everything right. This step-by-step installation guide explains how to create a DSC Configuration in Azure Automation and how to apply this on your domain controller in Azure. ...

22-07-2018 · 4 min · Jean-Paul van Ravensberg

Update Windows 10 with SCCM/WSUS only by defeating Dual Scan

**With Windows 10 1607, Microsoft introduced Dual Scan functionality, which allows the computer to connect with Microsoft Updates besides using WSUS or SCCM. Steve Henry from Microsoft: “It is for the enterprise that wants WU to be its primary update source while Windows Server Update Services (WSUS) provides all other content.” I’ve seen various blog posts not covering all the steps I had to take to ensure Windows only looks to SCCM/WSUS. ...

21-04-2018 · 4 min · Jean-Paul van Ravensberg

PowerShell - Signed scripts "cannot be loaded because running scripts is disabled"

So you are signing your PowerShell scripts as a Best Practice from Microsoft. Good job! You’ve configured the PowerShell Execution Policy as AllSigned and you’ve created an application in SCCM where you run the signed script as: PowerShell.exe -File .\Script.ps1 The application installs just fine on your machine from the Software Center. During the Task Sequence, the application cannot be installed and in the Event Viewer. You’ll find the following error message: ...

06-12-2017 · 1 min · Jean-Paul van Ravensberg

Create a Hyper-V NAT Switch with PowerShell - the easy way

You can follow the original guide by Microsoft and manually edit all the details, or just use the variables from the script below and let PowerShell do the work for you. # Variables $InternalSwitchName = "Internal Virtual Switch" $NATGatewayPrefixLength = "24" $NATGatewayNetwork = "192.168.0.0/$NATGatewayPrefixLength" $NATGatewayIP = "192.168.0.1" $NATNetworkName = "NAT Network" # Create the VM Switch and NAT Gateway New-VMSwitch -SwitchName $InternalSwitchName -SwitchType Internal New-NetIPAddress -IPAddress $NATGatewayIP -PrefixLength $NATGatewayPrefixLength -InterfaceIndex (Get-NetAdapter -Name $("vEthernet ($InternalSwitchName)")).InterfaceIndex New-NetNat -Name $NATNetworkName -InternalIPInterfaceAddressPrefix $NATGatewayNetwork

24-09-2017 · 1 min · Jean-Paul van Ravensberg

PowerShell - How to Create an Array with PSObject

As I told you before in my previous blog post, I was asked to build an interactive PowerShell script for creating Virtual Machines in Azure. In this blog post, I want to show you how I’ve created a report (or array) within PowerShell that: Visualize the to-be-created objects to the user Allows PowerShell to get the data of that array to create Virtual Machines. This makes sure that you have a consistent view of what PowerShell will create for you. See it as an order overview before you buy something online. Let’s imagine I have all the Virtual Machines that I want to create in $VMs. This can be an import of a CSV, or maybe I’ve asked the user for details with “Read-Host” or Out-GridView. ...

10-06-2017 · 2 min · Jean-Paul van Ravensberg

PowerShell - Using Out-GridView to Select a Parameter

Last week I was asked to build an interactive PowerShell script for creating Virtual Machines in Azure. In this blog post, I want to share an easy way to prompt a user for a selection. # Select Azure subscription $AzureSubscription = (Get-AzureRmSubscription | Out-GridView -Title "Choose your Azure subscription and click OK." -PassThru) Write-Output "Switching to Azure subscription: $($AzureSubscription.Name)" $AzureSubscriptionInfo = Select-AzureRmSubscription -SubscriptionId $AzureSubscription.Id This uses Out-GridView to display the contents of the “Get-AzureRmSubscription” Cmdlet and asks the user to make a selection. The user is able to sort and filter the contents within the grid and the user will be informed of the decision by using “Write-Output”. ...

04-06-2017 · 1 min · Jean-Paul van Ravensberg

Azure - A parameter cannot be found that matches parameter name

Some error outputs are not always useful. Especially when they make no sense for the issue you have. Error message: New-AzureRmResourceGroupDeployment : A parameter cannot be found that matches parameter name ‘YOURPARAMETER’ Solution: This error occurs because of at least the 2 following issues: You didn’t specify a parameter for ‘YOURPARAMETER’ in your JSON template. That’s what the error says. If you forget to specify a parameter with the New-AzureRmResourceGroupDeployment cmdlet, you’ll see a prompt to insert a value for that parameter. But if you add a paremeter like -Name “VM01” to the command while it’s not specified in the JSON template, you’ll see this error. The JSON code you provided isn’t valid. Always validate your JSON code. You can use http://www.jsoneditoronline.org/, paste your code and look for the red “X” buttons after a line number. Did you find another issue where this error occurs? Please let me know in the comments section. Cheers!

14-12-2016 · 1 min · Jean-Paul van Ravensberg