View PowerShell-AD-SCCM-Workstation-Cleanup-Script-Version-3.0.ps1
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
############################################################################### | |
# Author: Trevor Sullivan | |
# | |
# Date: October 28, 2009 | |
# | |
# Lessons learned: | |
# | |
# 1. ADSI property names are lower case using DirectorySearcher or DirectoryEntry | |
# 2. Must explicitly cast 64-bit integers from AD | |
# 3. The Excel API is terrible (already knew that) # |
View Dockerfile
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
FROM microsoft/windowsservercore | |
MAINTAINER Trevor Sullivan <tsulli@amazon.com> | |
SHELL ["powershell", "-Command"] | |
ENV PYTHON_DOWNLOAD https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe | |
ENV PYTHON_FILE python-3.6.3-amd64.exe | |
COPY Install-Boto3.py c:/Amazon/ |
View existing code to git repo
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
If you've got local source code you want to add to a new remote new git repository without 'cloning' the remote first, do the following (I often do this - you create your remote empty repository in bitbucket/github, then push up your source) | |
1. Create the remote repository, and get the URL such as git://github.com/youruser/somename.git | |
2. If your local GIT repo is already set up, skips steps 2 and 3 | |
3. Locally, at the root directory of your source, git init | |
4. Locally, add and commit what you want in your initial repo (for everything, | |
git add . |
View ClusterHQ-FlockerHub-Demo.sh
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
#!/bin/bash | |
### Visit http://ui.dev.voluminous.io/user-tokens to get a user token | |
### NOTE: This file should contain a function definition called 'fli' | |
source ~/.bash-fli | |
set -e | |
shopt -s expand_aliases |
View gist:4a1b74f37eaecac58cf777820f0177c9
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 Prompt { | |
<# | |
.Notes | |
Author: Trevor Sullivan | |
Website: https://trevorsullivan.net | |
Twitter: https://twitter.com/pcgeek86 | |
#> | |
$ATAT = @' | |
____==========_______ | |
_--____ | | "" " "| \ |
View PowerShell v5 Class Serialization Pattern.ps1
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
class Person { | |
[ValidateNotNullOrEmpty()] | |
[string] $FirstName; | |
[ValidateNotNullOrEmpty()] | |
[string] $LastName; | |
[string] $Address; | |
Person([string] $First, [string] $Last) { | |
$this.FirstName = $First; |
View Wait-AzureVMDscConfiguration.ps1
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 Wait-AzureVMDscConfiguration { | |
<# | |
.Synopsis | |
Waits for a DSC configuration to complete on an Azure Virtual Machine. | |
.Parameter ServiceName | |
The name of the Azure Cloud Service containing the Virtual Machine. | |
.Parameter Name | |
The name of the Azure Virtual Machine inside the Cloud Service container. |
View Get-AzureStorageContainersAsync.ps1
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
<# | |
.Author | |
Trevor Sullivan <pcgeek86@gmail.com> | |
.Links | |
http://trevorsullivan.net | |
http://twitter.com/pcgeek86 | |
.Description | |
This PowerShell script uses the Microsoft Azure PowerShell module along with PowerShell |
View Azure Disks by Storage Account.ps1
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
<# | |
Author: Trevor Sullivan | |
Date: 2015-03-29 | |
Description: Microsoft Azure Disk objects offer the full URL to the cloud-based VHD | |
however, the Storage Account name is not exposed independently. We can | |
use PowerShell's Add-Member command to parse the URL and offer up the | |
Storage Account as its own property on each Disk object. | |
#> | |
Select-AzureSubscription -SubscriptionName 'Visual Studio Ultimate with MSDN'; |
View Get-DscRequiredProperties.ps1
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
### Find the required properties for a particular DSC resource | |
(Get-DscResource | Out-GridView -PassThru).Properties; |