Skip to content

Instantly share code, notes, and snippets.

View alexjebens's full-sized avatar

Alexander Jebens alexjebens

View GitHub Profile
param (
[String] $ResourceGroupName = ''
)
# Returns strings with status messages
[OutputType([String])]
# Connect to Azure and select the subscription to work against
$servicePrincipalConnection = Get-AutomationConnection -Name AzureRunAsConnection
param (
[String] $ResourceGroupName = ''
)
# Returns strings with status messages
[OutputType([String])]
# Connect to Azure and select the subscription to work against
$servicePrincipalConnection = Get-AutomationConnection -Name AzureRunAsConnection
@alexjebens
alexjebens / appveyor.yml
Last active June 1, 2017 10:45
Azure Function C# Project AppVeyor yml
image: Visual Studio 2017
configuration: Release
before_build:
- cmd: nuget restore
after_build:
- cmd: 7z a myapp.zip %APPVEYOR_BUILD_FOLDER%\com.aboersch.PostProxy\bin\Release\net461\*
artifacts:
- path: myapp.zip
name: app
deploy:
@alexjebens
alexjebens / Test.ps1
Last active April 25, 2017 13:16
Partial Configuration Bug Repro
#region Ensure/Get Encryption Cert
function Get-CertThumbPrint(){
[OutputType([string])]
param(
[string]$CertPath
)
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($CertPath)
return $cert.Thumbprint.ToLowerInvariant()
New-ModuleManifest -Path 'C:\Program Files\WindowsPowerShell\Modules\DscTest\DscTest.psd1' `
-DscResourcesToExport @('DscCredentialTest') -PowerShellVersion 5.0 -Description '' `
-ModuleVersion '1.0.0.0' -Guid $([guid]::NewGuid()) -Author 'Alexander Boersch' `
-RootModule 'DscTest.psm1' -CompanyName 'Alegri'
@alexjebens
alexjebens / ghost-network-adapters-powershell.ps1
Last active January 22, 2023 22:55
Remove Ghost Network Adapters with PowerShell only
$T = @"
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Win32
{
public static class SetupApi
{
// 1st form using a ClassGUID only, with Enumerator = IntPtr.Zero
@alexjebens
alexjebens / ghost-network-adapters-devcon.ps1
Last active September 2, 2022 17:33
Removing Ghost Network Adapters with Windows SDK devcon.exe
param(
# Path to devcon.exe
[string]$devconPath = "C:\Program Files (x86)\Windows Kits\8.0\Tools\x64\devcon.exe"
)
<#
.Synopsis
Helper function to seperate devcon output between device id and name
#>
function Convert-ToDevice {
[CmdletBinding()]