Skip to content

Instantly share code, notes, and snippets.

View inammathe's full-sized avatar

Evan inammathe

View GitHub Profile
@inammathe
inammathe / Set-SkypeAvailability.ps1
Created May 18, 2021 00:13
Set-SkypeAvailability
$LyncSDKLocation = 'C:\LyncSDK\LyncSDK\Assemblies\Desktop'
import-module "$LyncSDKLocation\Microsoft.Lync.Utilities.dll"
import-module "$LyncSDKLocation\Microsoft.Lync.Controls.dll"
import-module "$LyncSDKLocation\Microsoft.Lync.Model.dll"
<#
SDK - https://www.microsoft.com/en-us/download/confirmation.aspx?id=36824
Extract msi out of the exe and run that to get the required assemblies
Microsoft.Lync.Utilities.dll
Microsoft.Lync.Controls.dll
@inammathe
inammathe / Format-PropertyData.ps1
Last active May 31, 2020 22:53
Utility PoSH function that allows you to format a property of any object
<#
.SYNOPSIS
Utility function that allows you to format a property of any object
.DESCRIPTION
Invokes a script block against any number of object properties to manipulate the data
.EXAMPLE
PS C:\> Format-PropertyData -data ([PSCustomObject]@{FirstName = 'Evan'; Price = 100.0001}) -ColumnFormat @{'Price' = {[MATH]::Round($_)}}
Applies the math rounding function to all data in the 'Price' column
#>
@inammathe
inammathe / Invoke-DbUp.ps1
Created September 19, 2018 16:13
Runs scripts against a database using DbUp
param(
$TargetDatabase,
$PackagePath,
$TargetServer,
$JournalToSqlTable,
$ConnectionTimeout,
$ExecutionTimeout,
$Static_ScriptsDir,
$Sandpit_ScriptsDir,
$TestEnv_ScriptsDir,
@inammathe
inammathe / Copy-OctopusVariableSet.ps1
Last active August 29, 2018 21:45
Copies from one Octopus Deploy project variables to another
Function Copy-OctopusVariableSet
{
<#
.SYNOPSIS
Copies from one Octopus Deploy project variables to another
.DESCRIPTION
Uses the Octopus rest api to get all variables from one project to replace all variables in another.
Super handy if you need to get a new project going with almost identical variables that don't yet exist in a project template or library set
.EXAMPLE
PS C:\> Copy-OctopusVariableSet `
@inammathe
inammathe / Test-CCNumber.ps1
Last active August 28, 2018 22:28
Test-CCNumber - Uses the Luhn algorithm to test if a number is a valid credit card number or not
Function Test-CCNumber {
<#
.SYNOPSIS
Tests for valid credit card numbers
.DESCRIPTION
Uses the Luhn algorithm to test if a number is a valid credit card number or not
.EXAMPLE
PS C:\> Test-CCNumber -Number 9003085869539691
Tests the number 9003085869539691
.EXAMPLE
@inammathe
inammathe / Set-ProcessPriorityClass.ps1
Last active June 30, 2018 02:22
Sets the process class of one or more processes
function Set-ProcessPriorityClass
{
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='Low')]
param(
# Names of the processes to change
[Parameter(Mandatory, ValueFromPipeline)]
[Alias("Name")]
[String[]]
$ProcessName,
<#
.SYNOPSIS
Uses XML transformation on a specified XML file
.DESCRIPTION
Performs XML configuration changes to a given XML file via XML-Document-Transform (XDT) commands specified within a seperate XML file.
.EXAMPLE
PS C:\> Use-XMLTransform -XML 'D:\myApp\app.config' -XDT 'D:\myApp\app.release.config'
Transforms configuration within app.config using the XDT commands found in app.release.config
.INPUTS
String literal paths to XML/XDT docs and optionally XmlTransform.dll