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
# This is Git's per-user configuration file. | |
[user] | |
name = Devyn Spencer | |
email = [email protected] | |
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
ll = log |
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
# Given a list of users and computer names, add the SAM account name to each | |
@{ | |
Users = @( | |
@{ | |
Name = "Joe Joesworthy" | |
ComputerName = "P9XYZ123" | |
} | |
@{ | |
Name = "Seandog Millionaire" | |
ComputerName = "MJXYZ123" |
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
workflow { | |
param( | |
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByValue)] | |
$ComputerName, | |
[pscredential] $Credential = "$env:USERDOMAIN\$env:USERNAME", | |
[switch] $All, | |
[switch] $Configuration, | |
[switch] $Users # sessions, user profiles, accounts, groups |
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
params ["_required1", "_required2", ["default1", "value"], ["default2", 5], ["default3", west]] | |
private ["_var1", "_var2", "_var3", "_var4"] | |
// header | |
_Zen_stack_Trace = ["Zen_ArrayAppend", _this] call Zen_StackAdd; | |
if !([_this, [["ARRAY"], ["VOID"], ["VOID"], ["VOID"], ["VOID"], ["VOID"], ["VOID"]], [], 2] call Zen_CheckArguments) exitWith { | |
call Zen_StackRemove; | |
}; | |
// execute something here |
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
function Repair-HomeDirectoryAcl { | |
Param( | |
# TODO: cast this as a file-object / review PowerShell idioms for working with directories | |
[Parameter(Mandatory, ValueFromPipeline) # TODO: , ValueFromPipelineByProperty)] | |
[string] $Path, | |
[switch] $Recurse | |
) | |
process { |
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
function ConvertTo-BooleanString ($value) { | |
return [System.Convert]::ToBoolean($value).ToString() | |
} |
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
Function New-Something { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$True, ValueFromPipeline=$True)] | |
[string[]] $ComputerName | |
) | |
begin { | |
} |
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
<# | |
-------------- | |
WSUS Installer v1 | |
-------------- | |
by Trevor Jones | |
This script installs and configures WSUS on a Windows 2012 server. | |
You have the option to use WID, Local SQL Express or an existing SQL Server. | |
If you choose Local SQL Express it will be downloaded and installed for you with a default configuration. | |
Report Viewer 2008 is also optionally installed, it is required to view WSUS reports. |
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
foreach ($Server in $servers) { | |
$key = “SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install” | |
$keytype = [Microsoft.Win32.RegistryHive]::LocalMachine | |
$RemoteBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($keytype,$Server) | |
$regKey = $RemoteBase.OpenSubKey($key) | |
$KeyValue = $regkey.GetValue(”LastSuccessTime”) | |
$System = (Get-Date -Format "yyyy-MM-dd hh:mm:ss") | |
if ($KeyValue -lt $System) { | |
Write-Host " " |
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
@echo off | |
Powershell -noprofile -executionpolicy bypass -file "C:\scripts\script.ps1" |
NewerOlder