Skip to content

Instantly share code, notes, and snippets.

View vniklas's full-sized avatar

vNiklas Akerlund vniklas

View GitHub Profile
@vniklas
vniklas / wmf5install.rb
Created April 19, 2016 21:15
Chef Cookbook recipe for adding WMF 5 to a win2012r2 server
#
# Cookbook Name:: demo_dsc
# Recipe:: wmf5install
#
# Copyright (c) 2016 vNiklas, All Rights Reserved.
#lets rocknroll
powershell_script 'updatewmfto5' do
code <<-EOH
param (
[Parameter()]
[ValidateSet('VMM','OM','DPM','SCORH','SM','All')]
[String] $Component = 'All',
[Parameter()]
[String] $Destination = $env:TEMP
)
Begin {
@vniklas
vniklas / Compare-Module.ps1
Created June 30, 2016 13:28 — forked from jdhitsolutions/Compare-Module.ps1
Use this command to compare module versions between what is installed against an online repository like the PSGallery. Results will be automatically sorted by module name.
#requires -version 5.0
Function Compare-Module {
<#
.Synopsis
Compare module versions.
.Description
Use this command to compare module versions between what is installed against an online repository like the PSGallery. Results will be automatically sorted by module name.
.Parameter Name
The name of a module to check. Wildcards are permitted.
# upgrading puppet with choco
#
# Niklas Akerlund
# Get version of puppet agent
$puppetversion = & puppet agent --version
# Get the latest run of puppet
$lastrun = Get-WinEvent -ProviderName Puppet -MaxEvents 35 | where {$_.Message -like "*Finished*" -or $_.Message -like "Applied*"} | sort TimeCreated -Descending | select -First 1 | select -ExpandProperty TimeCreated
$datenow = Get-Date
@vniklas
vniklas / download-resources.ps1
Last active November 12, 2019 19:09
Download MS Ignite sessions on Windows or Linux/Mac OS X
Param (
## The directory into which the user wishes to download the files.
[string]$directory = $PSScriptRoot,
## Optional parameter allowing the user to specifiy the code (or comma seperated codes) of the video(s) they wish to download.
[string]$sessionCodes = "",
[switch]$onlyppt,
[switch]$onlyvideo
)
### Variables ###
@vniklas
vniklas / IISInstall.ps1
Created August 30, 2021 11:07 — forked from jjgriff93/IISInstall.ps1
Windows Server 2016 - PowerShell DSC Config File - IIS Web Server
configuration IISInstall
{
node "localhost"
{
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
}