Skip to content

Instantly share code, notes, and snippets.

View jpogran's full-sized avatar
📙
Intersection of prose and technology

James Pogran jpogran

📙
Intersection of prose and technology
View GitHub Profile
$user = 'jpogran'
$today = [DateTime]::Now.date
$yesterday = [DateTime]::Now.AddDays(-1).date
function convert-state {
[CmdletBinding()]
param (
[Parameter()]
[string]
$state
@jpogran
jpogran / custom-minimal-settings.json
Last active April 27, 2021 18:41
Puppet Camp VS Code Tips Settings
{
// // settings for all languages
"editor.fontFamily": "'Cascadia Code PL', 'Cascadia Code', Consolas, monaco, monospace",
"editor.fontSize": 18,
"editor.minimap.enabled": false,
// "editor.suggest.showStatusBar": true,
// "editor.suggest.insertMode": "insert",
// "workbench.tree.indent": 16
@jpogran
jpogran / gist:ecbad59f75d1b2600cdb4bdfda8cdd7b
Created October 2, 2020 15:41
PowerShell SDK Examples
https://github.com/MicrosoftDocs/powershell-sdk-samples/tree/master/SDK-3.0
https://github.com/MicrosoftDocs/powershell-sdk-samples/tree/master/SDK-3.0/Remoting%20Disconnect%20Reconnect%20Sample%2001
https://github.com/MicrosoftDocs/powershell-sdk-samples/tree/master/SDK-3.0/Remote%20Runspace%20Sample%2001
https://github.com/MicrosoftDocs/powershell-sdk-samples/tree/master/SDK-3.0/Remote%20Runspace%20Pool%20Sample%2001
@jpogran
jpogran / Vagrantfile
Last active September 28, 2020 14:40
Windows vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/windows-server"
config.vm.provider "hyperv" do |hv, override|
hv.cpus = 2
hv.memory = 2048
hv.linked_clone = true
hv.enable_virtualization_extensions = true
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
@jpogran
jpogran / lcm_config.pp
Created May 24, 2019 14:34
Puppet Disable LCM
define dsc::lcm_config (
$refresh_mode = 'Disabled'
) {
validate_re($refresh_mode, '^(Disabled|Push)$', 'refresh_mode must be one of \'Disabled\', \'Push\'')
exec { "dsc_provider_set_lcm_refreshmode_${refresh_mode}":
provider => 'powershell',
onlyif => "if ((Get-DscLocalConfigurationManager).RefreshMode -eq '${refresh_mode}') {exit 1} else {exit 0}",
command => template('dsc/set-lcm-mode.ps1.erb'),
$LogName = 'Application'
$pathType = [System.Diagnostics.Eventing.Reader.PathType]::LogName;
$xpath = @"
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*</Select>
</Query>
</QueryList>
"@
{
"breadcrumbs.enabled": true,
"breadcrumbs.filePath": "off",
"breadcrumbs.symbolPath": "on",
"editor.dragAndDrop": false,
"editor.emptySelectionClipboard": false,
"editor.fontFamily": "'FuraCode NF Retina Medium', 'Fira Code Retina Medium', Consolas, 'Courier New', monospace",
"editor.fontSize": 14,
"editor.fontLigatures": true,
"editor.insertSpaces": true,
@jpogran
jpogran / Windows10-Setup.ps1
Created October 17, 2018 03:06 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0