Skip to content

Instantly share code, notes, and snippets.

Function Load-ConfigMgrAssemblies {
Param(
$AdminConsoleDirectory = ($env:SMS_ADMIN_UI_PATH | Split-Path -Parent)
)
#Add-Type -Path "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\DcmObjectModel.dll"
$filesToLoad = "Microsoft.ConfigurationManagement.ApplicationManagement.dll","AdminUI.WqlQueryEngine.dll", "AdminUI.DcmObjectWrapper.dll","DcmObjectModel.dll","AdminUI.AppManFoundation.dll","AdminUI.WqlQueryEngine.dll","Microsoft.ConfigurationManagement.ApplicationManagement.Extender.dll","Microsoft.ConfigurationManagement.ManagementProvider.dll","Microsoft.ConfigurationManagement.ApplicationManagement.MsiInstaller.dll"
Set-Location $AdminConsoleDirectory
[System.IO.Directory]::SetCurrentDirectory($AdminConsoleDirectory)
DesktopAppConverter.exe -Setup -BaseImage "C:\Users\mhenke\Downloads\BaseImage-14393.wim"
DesktopAppConverter.exe -Installer C:\dev\7-Zip.16.0.4\7z1604-x64.msi -PackageName "MyApp" -Publisher "CN=7zip" -Version "16.0.4.0" -MakeAppx -Destination "c:\dev" -verbose
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\makecert.exe" -r -h 0 -n "CN=7zip" -eku 1.3.6.1.5.5.7.3.3 -pe -sv myapp.pvk myapp.cer
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\pvk2pfx.exe" -pvk .\myapp.pvk -spc .\myapp.cer -pfx .\myapp.pfx
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign -f .\myapp.pfx -fd SHA256 -v C:\dev\MyApp\MyApp.appx
#Import Cert in Store
@ducke
ducke / README.md
Created November 12, 2015 15:24 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@ducke
ducke / git-random-tip.ps1
Created November 9, 2015 15:08 — forked from devlead/git-random-tip.ps1
PowerShell scrips that displays random GIT tips
(irm https://raw.githubusercontent.com/git-tips/tips/master/tips.json)|sort {random}|select -First 1|% {"$($_.title)`r`n$($_.tip)" }
@ducke
ducke / install_hubot.sh
Last active October 26, 2015 10:00
Hubot is awesome
sudo useradd hubot -m -d "/opt/hubot" -c "hubot user"
sudo usermod -a -G hubot hubot
cd /opt/hubot
sudo npm install -g coffee-script yo generator-hubot
BOT_OWNER=manuel.henke
BOT_NAME=gerty
BOT_DESC=awesome bot
BOT_ADAPTER=rocketchat
sudo -H -u hubot bash -c 'yo hubot --owner="$BOT_OWNER" --name="$BOT_NAME" --description="$BOT_DESC" --defaults'
sudo -H -u hubot bash -c 'npm install hubot-rocketchat'
@ducke
ducke / gist:006d735fe0d628680a6b
Last active October 21, 2015 19:40
Deploy rocket.chat
#https://github.com/RocketChat/hubot-rocketchat
# SYSTEM CONFIGURATION
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
apt-get update
apt-get install -y git nodejs npm mongodb-org curl
ln -s /usr/bin/nodejs /usr/bin/node
@ducke
ducke / http_server.ps1
Created October 19, 2015 15:47 — forked from nobodyguy/http_server.ps1
Powershell HTTP server in background thread (could be easily killed)
$ServerThreadCode = {
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add('http://+:8008/')
$listener.Start()
while ($listener.IsListening) {
$context = $listener.GetContext() # blocks until request is received
$request = $context.Request
@ducke
ducke / Set-WindowStyle.ps1
Created October 13, 2015 08:20 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowStyle {
param(
[Parameter()]
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE',
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED',
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')]
$Style = 'SHOW',
[Parameter()]
$MainWindowHandle = (Get-Process –id $pid).MainWindowHandle
$IP = '192.168.138.10'
$MaskBits = 24 # This means subnet mask = 255.255.255.0
$Gateway = '192.168.138.2'
$Dns = '192.168.138.2'
$IPType = 'IPv4'
# Retrieve the network adapter that you want to configure
$adapter = Get-NetAdapter | Where-Object {$_.Status -eq 'up'}
# Remove any existing IP, gateway from our ipv4 adapter
@ducke
ducke / gist:1c5bd2bb25f9c162da92
Last active October 1, 2015 19:42
Teamcity octo pack
try {
If (-not (choco list -l | Select-String -SimpleMatch 'octopustools' -Quiet)) {
throw 'No Chocolatey magig found. EXIT!'
}
$OctoPath = Join-Path $env:ChocolateyInstall bin
$OctoExe = Join-Path $OctoPath 'octo.exe'
$Args = '--help','pack','--id=','--include=','--basePath=','--outFolder=','--version=','--author=','--title=','--description='