This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
# Param1 help description | |
[Parameter(Mandatory=$true)] | |
$ServiceName | |
) | |
$status = (Get-Service -name $ServiceName) | |
if ($status.Status -ne 'Running') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------[Initialisations]-------------------------------------------------------- | |
# Makes PowerShell pull you up about everything.. | |
Set-StrictMode -Version Latest | |
# YOu don't need to put this in usually, but just to make sure in your ise. | |
$ErrorActionPreference = "Continue" | |
#Dot Source required Function Libraries | |
#. "Logging_Functions.ps1" | |
#----------------------------------------------------------[Declarations]---------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "mwrock/Windows2012R2" | |
config.vm.guest = :windows | |
config.vm.communicator = "winrm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$title = "This is Matt's Page" | |
$price = 20 | |
$color = 'red' | |
$html = | |
" | |
<HTML> | |
<HEAD> | |
<TITLE>$($title)</TITLE> | |
<BODY> | |
<font color=""$($color)""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires the Add-PathVariable function from my PowerShell Profile | |
Add-PathVariable -Path 'C:/opscode/chefdk/embedded/bin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install vagrant plugins | |
vagrant plugin install 'vagrant-berkshelf' | |
vagrant plugin install 'vagrant-dsc' | |
vagrant plugin install 'vagrant-omnibus' | |
vagrant plugin install 'vagrant-reload' | |
vagrant plugin install 'vagrant-vbguest' | |
vagrant plugin install 'vagrant-vbox-snapshot' | |
vagrant plugin install 'vagrant-winrm' | |
vagrant plugin install 'winrm-fs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a symlink to the profile in your shared drive | |
cmd /c mklink $PROFILE D:\DataHodge\Dropbox\PSProfile\Microsoft.PowerShell_profile.ps1 | |
# Load the profile into the current session | |
. $PROFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$webData = @{ | |
name = 'Matt' | |
fontcolor = 'red' | |
type = 'beer' | |
price = '6.00' | |
age = 29 | |
} | |
$htmlPage = " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When our string contains double quotes | |
$myItem = @{ | |
name = 'Matt' | |
age = 29 | |
} | |
$myStringBackTicks = "The user `"$($myItem.name)`" is of age `"$($myItem.age)`"" | |
$myStringDoubleQuotes = "The user ""$($myItem.name)"" is of age ""$($myItem.age)""" | |
Write-Output $myStringBackTicks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When our string contains single quotes | |
$myItem = @{ | |
name = 'Matt' | |
age = 29 | |
} | |
$myString = "The user '$($myItem.name)' is of age '$($myItem.age)'" | |
Write-Output $myString |