This file contains hidden or 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( | |
| [string] $source, | |
| [string] $target, | |
| [string] $fat_args = "/FFT /Z /XA:H /W:5" | |
| [switch] $mirror | |
| ) | |
| if ($mirror) { | |
| Invoke-Expression ("robocopy {0} {1} /MIR {2}" -f $source, $target, $fat_args) | |
| } | |
| else { |
This file contains hidden or 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
| # $HOME/.gitconfig | |
| [user] | |
| name = Rob Thijssen | |
| email = [email protected] | |
| [core] | |
| autocrlf = true | |
| [http] | |
| proxy = http://127.0.0.1:3128 | |
| [https] | |
| proxy = http://127.0.0.1:3128 |
This file contains hidden or 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 Add-LocalGroupDomainUser { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory = $true)] | |
| [string] $computer, | |
| [Parameter(Mandatory = $true)] | |
| [string] $group, | |
| [Parameter(Mandatory = $true)] |
This file contains hidden or 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( | |
| [string] $username = $env:username | |
| ) | |
| function Get-User { | |
| param( | |
| [System.String] $username | |
| ) | |
| $ds = New-Object System.DirectoryServices.DirectorySearcher | |
| $ds.Filter = "(&(objectCategory=person)(sAMAccountName=$username))" | |
| $ds.SearchRoot = "LDAP://{0}" -f ([ADSI] "LDAP://RootDSE").Get("rootDomainNamingContext") |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <configuration> | |
| <!-- | |
| ... | |
| --> | |
| <system.applicationHost> | |
| <applicationPools> | |
| <add name="DefaultAppPool" /> | |
| <add name="Classic .NET AppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" /> | |
| <add name=".NET v2.0 Classic" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" /> |
This file contains hidden or 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( | |
| [string] $username, | |
| [string] $password, | |
| [string] $baseUrl = "http://teamcity:8111", | |
| [int] $sleep = 10, | |
| [int] $timeout = 600 | |
| ) | |
| function Execute-TeamCityBackup { | |
| param( | |
| [string] $baseUrl, |
This file contains hidden or 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( | |
| [string] $archive, | |
| [string] $savePath, | |
| [string] $filename = [System.IO.Path]::GetFileName($savePath) | |
| ) | |
| [Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null | |
| $outStream = New-Object System.IO.FileStream ("$savePath"), 'Create' | |
| $inStream = ([System.IO.Compression.ZipFile]::OpenRead($archive).Entries | Where { $_.Name -eq $filename }).Open() | |
| $inStream.CopyTo($outStream) | |
| $inStream.Close() |
This file contains hidden or 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
| <# | |
| .Synopsis | |
| Create website under IIS on a remote host. | |
| .Description | |
| Create a website and its Application Pool. Set properties of both. | |
| .Parameter site | |
| Defines the display name (in IIS Manager) of the website. | |
| Mandatory parameter | |
| .Parameter port | |
| Defines the listening port for the website. |
This file contains hidden or 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
| <# | |
| .Synopsis | |
| Trigger a TeamCity backup using the TeamCity REST API. | |
| .Parameter username | |
| Defines a TeamCity username which has authority to trigger backups. | |
| .Parameter password | |
| Defines the password for the user which will trigger the backup. | |
| .Parameter baseUrl | |
| Defines the URL to the TeamCity server (eg: http://teamcity.example.com). | |
| If not set, the script will attempt to determine it from the TeamCity properties file. |
This file contains hidden or 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
| $webClient = New-Object System.Net.WebClient | |
| $webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
| Invoke-Expression ($webClient.DownloadString('https://chocolatey.org/install.ps1')) |