Skip to content

Instantly share code, notes, and snippets.

function Get-ImageTakenDate {
[CmdletBinding()]
param (
# Path
[Parameter(Mandatory)]
[string]
$Path
)
try {
function Happy-ValentinesDay () {
param (
[Parameter(Mandatory)]
[datetime]
$TheBeginning
)
while ($true) {
$TimeInLove = (Get-Date) - $TheBeginning
$Days = "{0:d4}" -f $TimeInLove.Days
<?xml version="1.0" encoding="utf-8"?>
<RDCMan schemaVersion="1">
<version>2.2</version>
<file>
<properties>
<name></name>
<expanded>True</expanded>
<comment />
<logonCredentials inherit="None">
<userName></userName>
function New-RDCManFile () {
param (
# AD Group Names
[Parameter(Mandatory=$true)]
[string[]]
$ADGroupName,
# Output File
[Parameter(Mandatory=$false)]
[string]
<#
* Heavily modified from:
* https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/Examples/PullServerDeploymentVerificationTest/PullServerSetupTests.ps1
*
* Once you setup your pull server with registration, run the following set of tests on the pull server machine
* to verify if the pullserver is setup properly and ready to go.
#>
<#
* Prerequisites:
<#
.SYNOPSIS
Deploy using Robocopy or Copy-Item for folder and file deployments, respectively.
.DESCRIPTION
Deploy using Robocopy or Copy-Item for folder and file deployments, respectively.
Runs in the current session (i.e. as the current user)
.PARAMETER Deployment
function Invoke-Robocopy () {
[cmdletbinding()]
param (
# Copy from location
[Parameter(Mandatory=$true)]
[string]
$Path,
# Copy to location
[Parameter(Mandatory=$true)]
$RawXAML = @"
<Window x:Class="WpfApplication3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication3"
mc:Ignorable="d"
Title="MainWindow" Height="344.151" Width="232.521" ResizeMode="NoResize">
<Grid>
# Note: Edited from
# https://foxdeploy.com/resources/ise-snippets/xaml-to-gui/ original XAML loader script
# Change contents of here string to your XAML code from Visual Studio
$RawXAML = @"
Enter XAML contents here
"@
[void][System.Reflection.Assembly]::LoadWithPartialName('PresentationFramework')
[xml]$XAML = $RawXAML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^<Win.*', '<Window'
<#
Author: Joshua Barton
Version: 1.0
Version History:
Purpose: Get last expected reboot time for a server that reboots on Nth Xday of the Month
#>
function Get-MonthlyReboot () {