Skip to content

Instantly share code, notes, and snippets.

function DrawMenu {
## supportfunction to the Menu function below
param ($menuItems, $menuPosition, $menuTitel)
$fcolor = $host.UI.RawUI.ForegroundColor
$bcolor = $host.UI.RawUI.BackgroundColor
$l = $menuItems.length + 1
cls
$menuwidth = $menuTitel.length + 4
Write-Host "* $menuTitel *" -fore $fcolor -back $bcolor
class tunables::windows {
#using the from source https://github.com/puppetlabs/puppetlabs-registry.git
#not forge
#i just added this line thinking it might help
require registry
registry_value { 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\browser\Parameters\MaintainServerList':
# Verbose data types that can be used instead of single letters
DATA_TYPES = {
'ATOM' => 'I',
'BOOL' => 'B',
'BOOLEAN' => 'B',
'BYTE' => 'I',
'CALLBACK' => 'K',
'CHAR' => 'I',
'COLORREF' => 'L',
'DWORD' => 'L',
#cluster_name, nodes, ips
cluster_name = 'cc-git.office.iseoptions.com'
nodes = ['cc-git01']
ips = ['30.3.4.45']
version = 0x700
cluster_name = utf8_to_utf16le(cluster_name)
cluster_config = Struct.new(:version, :clustername, :nodecount, :nodes, :ipcount, :ips, :emptycluster)
node_array_ptr=[]
$cwd='C:/Program Files (x86)/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type/file'
$patch='source.rb.patch'
$patchbin='C:\Tools\gnuwin32\bin\patch.exe'
exec {"apply patch for ${title}":
command => "${patchbin} -p0 < ${patch}",
cwd => $cwd,
onlyif => "${patchbin} -p0 -N --dry-run --silent < ${patch}",
}
@rismoney
rismoney / gist:7001175
Created October 16, 2013 01:17
Import_RES_2_XD7.ps1
https://github.com/arpheus/xd7publisher/blob/master/Import_RES_2_XD7.ps1
sample publish app script relevant section...
PS C:\gitrepos\chocolatey> .\build.bat
Build started 9/8/2014 4:36:54 PM.
Project "C:\gitrepos\chocolatey\build.proj" on node 1 (Go target(s)).
Tests:
cmd /c C:\gitrepos\chocolatey\test.cmd
Path is %SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Tools\Perl64\site\bin;C:\Tools\Perl64\bin;C:\Program Files (
x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerS
hell\v1.0\;c:\Chocolatey\bin;C:\Program Files (x86)\Enterprise Vault\EVClient\x64\;C:\@inf\winbuild\scripts;c:\Chocol
atey\bin;C:\Windows\idmu\common;C:\Tools\sysinternals;C:\@inf\winbuild\scripts\;C:\Program Files\Microsoft Network Mo
nitor 3\;C:\Program Files (x86)\vim\vim73;C:\Tools\putty;C:\Tools\csvpng;C:\HashiCorp\Vagrant\bin;C:\Program Files (x
@rismoney
rismoney / gist:1012af6cce0bd962f2f4
Created October 13, 2014 14:44
Citrix Director Service.AutoDiscoveryAddress
saw your post here-
#http://forums.iis.net/t/1200953.aspx?Modifying+advanced+application+settings+with+Powershell
#figured I would post this since I saw you were having an issue setting Citrix Director IIS settings via powershell.
<#
.SYNOPSIS
Script to dump nic configuration to YAML
.PARAMETER Servername
.EXAMPLE
1. get-nic.ps1 servername
2. import-csv .\svr-ou.csv | Where-Object {$_.name -like "I*"} | select name | foreach {get-nic -computer $_.name}
{
"Type": "UnencryptedConfiguration",
"NetworkConfigurations": [
{
"GUID": "{guid1}",
"Name": "foo",
"Type": "VPN",
"VPN": {
"Type": "OpenVPN",
"Host": "foo.myqnapcloud.com",