Skip to content

Instantly share code, notes, and snippets.

View steviecoaster's full-sized avatar
🤠
It's a sweet day to write some Powershell

Stephen Valdinger steviecoaster

🤠
It's a sweet day to write some Powershell
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<Page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="LetsEncrypt" Description="Front End for SSL Cert generation based on Let's Encrypt" Authenticated="false" ShowInNavigation="true" ShowNavigation="true">
<Components>
<Form Id="6594b4c1-92a7-4190-831c-88d36efd5530" Title="Certificate Details" Description="Enter Details for the certificate here" SuccessTitle="Certificate Generated!" SuccessDescription="You'll receive an email with your Certificate within 2 minutes." RefreshComponents="true">
<Target Name="New-LetsEncryptCertificate.ps1" Type="script">
<Fields>
<Field Name="CertificateDnsName" Tooltip="Enter the Subject of the certificate you wish to generate. Supports Wildcard" Value="example.foo.org" Type="textbox" Required="false" />
<Field Name="PFXPassphrase" Tooltip="This is the password on the certificate used to import it on other systems. DO NOT LOSE THIS ONCE YOU SE
@steviecoaster
steviecoaster / ChocoJenkinsPlugins.ps1
Created August 10, 2021 13:38
Install base jenkins plugins for Chocolatey
$JenkinsHome = "C:\Program Files (x86)\Jenkins"
$JenkinsConfigPath = Join-Path $JenkinsHome "config.xml"
$JenkinsPlugins = @{
'cloudbees-folder' = '6.15'
'trilead-api' = '1.0.13'
'antisamy-markup-formatter' = '2.1'
'structs' = '1.23'
'workflow-step-api' = '2.23'
'token-macro' = '2.13'
'build-timeout' = '1.20'
function Remove-ChocoTemplateComment {
<#
.SYNOPSIS
Removes code comments from a templated choco package.
.DESCRIPTION
Removes code comments from a templated choco package.
.PARAMETER Script
The script to remove comments from.
[CmdletBinding()]
Param(
[Parameter()]
[String]
$Path = 'C:\drop'
)
process {
$FileFilter = '*'
$IncludeSubfolders = $false
@steviecoaster
steviecoaster / largepkg.ps1
Last active August 23, 2022 15:12
large package example
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://server:8443/repository/choco-install/npp.7.9.3.Installer.x64.zip'
$zipChecksum = 'c3a5c0d10747f80d0e60767b92a8ee4e8f0bdc5067b8747368fcf322926f887c'
$zipArgs = @{
PackageName = $env:ChocolateyPackageName
url = $url
unzipLocation = $toolsDir
checksum = $zipChecksum
@steviecoaster
steviecoaster / Open-GitRepo.ps1
Last active July 8, 2021 01:26
Quickly open Git repos on your machine.
Function Open-GitRepo {
<#
.SYNOPSIS
Changes your $pwd to the directory of the requested repo name
.DESCRIPTION
Changes your $pwd to the directory of the requested repo name
.PARAMETER Repo
The repo to open
@steviecoaster
steviecoaster / Set-NonDomainRemoting.ps1
Created April 7, 2021 15:35
Quickly setup PSRemoting on Non-domain bound endpoints
[CmdletBinding()]
Param(
[Parameter(Mandatory)]
[String[]]
$TrustedHosts
)
begin {
if(-not (Test-WSMan)){
Enable-PSRemoting -Force
@steviecoaster
steviecoaster / ChocoAudit.ps1
Created March 9, 2021 19:39
Chocolatey Package Audit Report
choco list -lo --audit -r |
ConvertFrom-Csv -Delimiter '|' -Header Package,Version,InstalledBy,Domain,RequestedBy,InstallDate |
Select Package, Version,
@{Name='InstalledBy';Expression={$_.InstalledBy -replace ('User:','')}},
@{Name='Domain';Expression={$_.Domain -replace ('Domain:','')}},
@{Name='RequestedBy';Expression={$_.RequestedBy -replace ('Original User:','')}},
@{Name='InstallDate';Expression={$_.InstallDate -replace ('InstallDateUtc:','')}} |
ConvertTo-Html -Title "Chocolatey Package Audit" -PreContent "Machine: $env:COMPUTERNAME" > C:\temp\audit.htm
@steviecoaster
steviecoaster / Set-EnvironmentVariable.ps1
Last active February 17, 2021 22:44
Sets a System level environment variable to machine, currentuser, or process scope.
function Set-EnvironmentVariable {
<#
.SYNOPSIS
Sets a system environment variable
.DESCRIPTION
Sets an environment variable in either machine, currentuser, or process scope
.PARAMETER Scope
The scope to set variable too
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Stephanie Valdinger",
"label": "Veterinary Technician",
"picture": "",
"email": "myemailaddress@foo.com",
"phone": "(740) 555-5555",