Skip to content

Instantly share code, notes, and snippets.

Developing code for my PSConfEU Sessions

Stefan Stranger stefanstranger

Developing code for my PSConfEU Sessions
Block or report user

Report or block stefanstranger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View azure.pipeline.yaml
# CCoE Demo Pipeline for simple webpage stored on Storage Account
- master
# Set variables
ResourceGroupName: "CCoE-Demo-RG"
azureSubscription: "CCoE-Demo-RG"
stefanstranger / tesla.yaml
Created Sep 22, 2019
Swagger Tesla REST API file
View tesla.yaml
swagger: "2.0"
description: |
A swagger representation of the unofficial Tesla API for Model S and Model X Vehicles. To use the API directly from the SwaggerHub documentation, click the `Interactive API Docs` tab and follow these steps:
* Authenticate with the `/oauth/token` operation. Use your **tesla** email address and password
* In the response, copy the `access_token` value.
* Click the `Authenticate` button and enter `Bearer {access_token}` (replace `{access_token}` with the value you copied previously)
You are now logged in to the Tesla API from within the Swagger docs. Typical usage of the API is performed by:
View run.ps1
#Show the HTML preview
$view = New-VSCodeHtmlContentView -Title "TestHTML" -ShowInColumn One
Set-VSCodeHtmlContentView -View $view -Content "<h1>Test Output</h1>"
Write-VSCodeHtmlContentView $view -Content "Run ps1<br />"
Write-VSCodeHtmlContentView $view -AppendedHtmlBodyContent "<p><img src=`"`" width=`"451`" height=`"451`" /></p>"
Show-VSCodeHtmlContentView -HtmlContentView $view
stefanstranger / Create-AADGroup.ps1
Last active Mar 15, 2019
Create an Azure Active Directory Group with the Graph API
View Create-AADGroup.ps1
Create an Azure Active Directory Group and add owner and members via Graph API with Service Principal
Make sure you have configured the correct Graph API permissions for the App Registration to manage AAD Groups
#region variables
$Tenantid = '[enter your Active Directory tenantid]'
$ClientID = '[Enter the application id of your Service Principal]'
stefanstranger / installpowershell.txt
Created Dec 3, 2018
Installing PowerShell 6.1 in
View installpowershell.txt
apt-get install liblttng-ust0
apt-get -f install
dpkg -i powershell_6.1.1-1.ubuntu.16.04_amd64.deb
View Get-AzureRMCommand.ps1
Function to find Cmdlet in PowerShell Scripts.
Use-case scenario:
- Find all Azure RM Cmdlets used in PowerShell script to find the impact of the change from AzureRM to AZ PowerShell Modules.
More info:
Example usage:
Get-AzureRMCommand -Path 'C:\Scripts\' -Name "azure"
Returns the following output:
Cmdlet Type File
stefanstranger / HelloWorldUD-Example.ps1
Last active Oct 10, 2018
Hello Word - Universal Dashboard Example
View HelloWorldUD-Example.ps1
$MyDashboard = New-UDDashboard -Title "Hello World" -Content {
New-UDCard -Title "Hello World - Universal Dashboard"
Start-UDDashboard -Port 8585 -Dashboard $MyDashboard -Name 'HelloWorldDashboard' -Wait
stefanstranger / poopcompiler.ps1
Created Dec 6, 2017 — forked from nohwnd/poopcompiler.ps1
emojicode in PowerShell
View poopcompiler.ps1
function 🐙 {
$name,$params = $args.Where({$_ -eq '💩'},'Until')
$null,$groups = $args.Where({$_ -eq '💩'},'SkipUntil')
$params = @($params |? {$_})
$bodyText = $groups | %{
$enumerator = [System.Globalization.StringInfo]::GetTextElementEnumerator($_)
$letters = while ($enumerator.MoveNext())
stefanstranger / UniversalDashboardMSFTStock.ps1
Created Sep 6, 2017
Microsoft Stock overview using Universal Dashboard
View UniversalDashboardMSFTStock.ps1
Example Dashboard for showing Microsoft Stock Value last 6 months.
- Universial Dashboard:
- Stock API:
$Dashboard = Start-Dashboard -Content {
New-Dashboard -Title "Stockprice Dashboard" -Color '#FF050F7F' -Content {
New-Row {
View Install-WindowsUpdate.ps1
Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot -Confirm:$FALSE
You can’t perform that action at this time.