Skip to content

Instantly share code, notes, and snippets.

View gaelcolas's full-sized avatar
Working from home

Gael gaelcolas

Working from home
View GitHub Profile
# Put code you'd like to run during dashboard startup here.
New-UDDashboard -Title 'a' -Pages @(
# Create a page using the menu to the right ->
# Reference the page here with Get-UDPage
New-UDPage -Name 'Select a folder' -Content {
$Page:Path = $Env:USERPROFILE
New-UDPaper -Content {
New-UDAutocomplete -id 'myPath' -Value $Page:Path -Variant filled -FullWidth -OnLoadOptions {
$options = @(
function Get-DscSplattedResource {
gaelcolas / kitchen.yml
Created June 8, 2022 21:43
example kitchen yaml for testing GC packages
# Check this doc:
# you may set the following environment variables:
# AZURE_CLIENT_ID="your-azure-client-id-here"
# AZURE_CLIENT_SECRET="your-client-secret-here"
# AZURE_TENANT_ID="your-azure-tenant-id-here"
# (check doc for more details)
name: azurerm
gaelcolas / Invoke-SamplerGit.ps1
Last active May 30, 2022 20:42
Testing a task file for git public/private repo release structure
Executes git with the provided arguments.
This command executes git with the provided arguments and throws an error
if the call failed.
gaelcolas / dummy jinja composite.ps1
Created April 22, 2021 15:51
basic jinja composite with explicit parameters
Configuration MyComposite {
Params (
$TemplateFilePath = 'MyJinja2Template.tpl',
$tempParamFile = [io.Path]::GetTempFileName()
gaelcolas / DynamicParam.draft.ps1
Last active August 1, 2019 16:30
PowerShell Generating dynamic parameters and parameter sets to wrap around a Class for easy instantiation such as new-Type -ctorArg1 $val -property $val2
#region Get-TypeDynamicParam
function Get-DynamicParamFromTypeName {
function New-ParamAttribute {
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipelineByPropertyName=$true, position=0)]
Configuration MyDscConfig {
# Import the module that has the 'ServerType' configuration
Import-DscResource -ModuleName Platform
# Import the module that has the 'Application' Configuration
Import-DscResource -ModuleName Product
$ConfigurationData.AllNodes.Nodename {
$ConfigurationName = $_
$ConfigurationParameters = $ConfigurationData.Roles.($Node.Role).($ConfigurationName)
gaelcolas / Invoke-TestHandlerAction.ps1
Created November 7, 2018 09:49
Example of a Datum handler that can reference another datum based on its path (rough and dirty)
function Invoke-TestHandlerAction {
gaelcolas / new_unattend_iso.ps1
Created July 9, 2016 21:45
create ISO with my Unattend.xml file
. '.\TestKitchen\script\IsoFile.ps1'
#create ISO with my Unattend.xml file
New-IsoFile -Source .\TestKitchen\Unattend.xml -Path .\TestKitchen\Unattendxml.iso -Force -Title MyISO
$ConfigurationData = @{
AllNodes = @(
Nodename = 'SRV01'
Role = 'ServerType1_Application'
Nodename = 'SRV02'
Role = 'ServerType2_Application'