Skip to content

Instantly share code, notes, and snippets.

Avatar

Brandon Stiff BrandonStiff

View GitHub Profile
@BrandonStiff
BrandonStiff / Get-Weather.ps1
Created Nov 12, 2019
Get the Weather using OpenWeatherMap API
View Get-Weather.ps1
function Get-Weather
{
<#
.SYNOPSIS
This function makes an API call to openweathermap.org and retrieves the weather for my city.
.PARAMETER Zip
Specifies the zip code to get the weather for.
.PARAMETER Unit
@BrandonStiff
BrandonStiff / Copy-VmVAppProperty.ps1
Created Jun 4, 2018
Copy all VM vApp properties from one vCenter server to another.
View Copy-VmVAppProperty.ps1
function Copy-VmVAppProperty()
{
<#
.SYNOPSIS
This function copes all VM vApp properties from the VMs in one VCenter server to another.
.PARAMETER SourceVCenter
Specifies the source vCenter server.
.PARAMETER DestinationVCenter
@BrandonStiff
BrandonStiff / Copy-VCenterAnnotations.ps1
Last active Jun 4, 2018
Copy VM Annotations from one vCenter server to another
View Copy-VCenterAnnotations.ps1
function Copy-VCenterAnnotations()
{
<#
.SYNOPSIS
This function copes all custom attributes and annotations from the VMs on one VCenter server to another.
.PARAMETER SourceVCenter
Specifies the source vCenter server.
.PARAMETER DestinationVCenter
@BrandonStiff
BrandonStiff / Add-BoshVCenterAccount.ps1
Last active May 16, 2018
Grants the correct vSphere permissions to the specified service user/group for BOSH director to function.
View Add-BoshVCenterAccount.ps1
function Add-BoshVCenterAccount()
{
<#
.SYNOPSIS
Grants the correct vSphere permissions to the specified service user/group for BOSH director to function.
.DESCRIPTION
This function creates a new vSphere role called PKS Administrators if it does not exist already. It then assigns the specified local or domain user/group to the role at the root vCenter server object.
.PARAMETER Group
@BrandonStiff
BrandonStiff / Any.json
Created Jul 26, 2017
Example ExecutionContext using Type Any
View Any.json
{
"parameters": [
{
"value": {
"properties": {
"property": [
{
"key": "p1",
"value": {
"number": {
@BrandonStiff
BrandonStiff / Set-SslCertificateValidation
Last active Jun 7, 2017
Set-SslCertificateValidation
View Set-SslCertificateValidation
function Set-SslCertificateValidation
{
<#
.SYNOPSIS
This function enables or disables SSL Cert validation in your PowerShell session. Calling this affects SSL validation for ALL function calls in the session!
.PARAMETER Disable
If specified, validation is disabled. If not specified (the default) validation is re-enabled.
.EXAMPLE
View Invoke-AdReplicationSync
function Invoke-AdReplicationSync()
{
<#
.SYNOPSIS
Invokes an immediate AD Replication.
.PARAMETER AdServer
Specifies the AD server to replicate to. This server pulls AD data from all of its partners.
.PARAMETER Partition
@BrandonStiff
BrandonStiff / Get-AdReplicationStatus
Last active Jun 5, 2017
Get Active Directory Replication Status
View Get-AdReplicationStatus
function Get-AdReplicationStatus()
{
<#
.SYNOPSIS
This function returns the status of AD replication.
.PARAMETER AdServer
Specifies the name of the AD Server to query the status of. The default is the local machine.
.PARAMETER SiteName
@BrandonStiff
BrandonStiff / New-CaCertificate.ps1
Last active Dec 3, 2019
OpenSsl Certificate PowerShell functions
View New-CaCertificate.ps1
function Invoke-OpenSsl
{
<#
.SYNOPSIS
Invokes a call to the openssl.exe program
.PARAMETER OpenSslPath
Specifies the path to the Openssl.exe executable. Default is C:\program files\Git\usr\bin\openssl.exe
.PARAMETER Parameters
@BrandonStiff
BrandonStiff / Import-PSCredential.ps1
Last active Apr 19, 2017
Import a PowerShell Credential
View Import-PSCredential.ps1
function Import-PSCredential
{
<#
.SYNOPSIS
Imports a credential exported by Export-PSCredential and returns a Credential.
.PARAMETER Path
Specifies one or more files to convert from XML files to credentials.
.PARAMETER RegistryPath
You can’t perform that action at this time.