full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/GithubGist/ylorn_11153460_raw_043d2538dcd541cfef8b128e5014a025519004a8_aria2_daemon.ps1 | ylorn_11153460_raw_043d2538dcd541cfef8b128e5014a025519004a8_aria2_daemon.ps1 | # troy at 164.218.21.198.tigernet.wifi.dyn.clemson.edu in ~ [15:17:28]
$ ps aux|grep aria2c
root 92 7.8 0.3 2464048 21292 ?? Ss 2:58PM 0:20.59 /usr/local/Cellar/aria2/1.18.5/bin/aria2c --conf-path=/Users/troy/.aria2/aria2.conf
troy 990 0.0 0.0 2442000 632 s000 S+ 3:... |
PowerShellCorpus/GithubGist/harriha_11332150_raw_12cca0ee9d1d17a88a24438c174df0faade76496_show-wifi-passwords.ps1 | harriha_11332150_raw_12cca0ee9d1d17a88a24438c174df0faade76496_show-wifi-passwords.ps1 | (netsh wlan show profiles) | # Fetch all Wi-Fi profiles
Select-String "\:(.+)$" | # Grab the profile name (note: not necessarily equal to SSID)
%{$name=$_.Matches.Groups[1].Value.Trim(); $_} | #... |
PowerShellCorpus/GithubGist/Haacked_6251969_raw_619dc02739688268aa40bea1a4c5b4c1056df9c2_Microsoft.Powershell_profile.ps1 | Haacked_6251969_raw_619dc02739688268aa40bea1a4c5b4c1056df9c2_Microsoft.Powershell_profile.ps1 | $dir = (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
Push-Location $dir
. (Resolve-Path "$dir\vs2010.ps1")
# . "Bradwils\profile.ps1"
$env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
# Set up GitHub environment
Write-Host "Setting up GitHub Environment"
. (Resolve-Pa... |
PowerShellCorpus/GithubGist/gierschv_4642887_raw_93f6f46803fec590e426cb1c2a08354e2a902e5e_MusicJSON.ps1 | gierschv_4642887_raw_93f6f46803fec590e426cb1c2a08354e2a902e5e_MusicJSON.ps1 | # Epitech / EIP Technical assessment
# VM EIP: Launch first `Set-ExecutionPolicy RemoteSigned`
# Variables
$basedir = "$env:HOMEDRIVE$env:HOMEPATH\Desktop\tmp"
$nodeVersion = "v0.8.18"
# Common
$webClient = New-Object System.Net.WebClient
$shell = New-Object -com shell.application
# Create Base directory
... |
PowerShellCorpus/GithubGist/PeteGoo_f3efb6c32ac65d0a1710_raw_5daccb158f10e87ad512e2efb755214221167ab8_Clone-SvnToGit.ps1 | PeteGoo_f3efb6c32ac65d0a1710_raw_5daccb158f10e87ad512e2efb755214221167ab8_Clone-SvnToGit.ps1 | <#
.SYNOPSIS
Clones an SVN repository usng git-svn, mapping users using Active Directory.
.DESCRIPTION
This function is a wrapper around git-svn that tries to resolve the names and email addresses of all users in the commit history
.Parameter SvnPath
The full path to the SVN repository
.Pa... |
PowerShellCorpus/GithubGist/rgsteele_f08f817d955440bb98c4_raw_e3b8cba4e362d4639c18357312207268fc313f71_Deploy-Application.ps1 | rgsteele_f08f817d955440bb98c4_raw_e3b8cba4e362d4639c18357312207268fc313f71_Deploy-Application.ps1 | <#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall" deployment type.
The install deploy... |
PowerShellCorpus/GithubGist/guitarrapc_1da7d92a160e085507ee_raw_c76de783f34762ff28d293c656a6ca00949637ef_ChefRecipeAndDSCConfiguration.ps1 | guitarrapc_1da7d92a160e085507ee_raw_c76de783f34762ff28d293c656a6ca00949637ef_ChefRecipeAndDSCConfiguration.ps1 | # Chef Recipe rule
[cookbook] 'Nae' do
[Key_name] "[key_value]"
[value_name] "[value_value]"
end
# Chef DSC call EnvironemtResource with : https://github.com/opscode-cookbooks/dsc
env 'editor' do
key_name "EDITOR"
value "vim"
end
# DSC Configuration Sample
environment editor
{
... |
PowerShellCorpus/GithubGist/xcud_4683707_raw_1f4f58f066285cf7cc5a52cdb2027af437ca0bc6_Load-Assembly.ps1 | xcud_4683707_raw_1f4f58f066285cf7cc5a52cdb2027af437ca0bc6_Load-Assembly.ps1 | <#
.Synopsis
Pipeable shortcut for [reflection.assembly]::LoadFrom.
.Example
PS> dir c:\foo.dll | Load-Assembly
GAC Version Location
--- ------- --------
False v2.0.50727 C:\foo.dll
#>
function Load-Assembly {
param( [Parameter(Mandatory=$True, Positi... |
PowerShellCorpus/GithubGist/rkeithhill_46b9c22407d067af8534_raw_17427eb4cbab23a64c82ca13a2044488dd263f2f_Go.ps1 | rkeithhill_46b9c22407d067af8534_raw_17427eb4cbab23a64c82ca13a2044488dd263f2f_Go.ps1 | <#
.SYNOPSIS
The go function allows you to prepopulate a list of common destinations accessed by a short key.
.DESCRIPTION
The go function allows you to prepopulate a list of common destinations accessed by a short key
such as 'h' for your home directory.
.PARAMETER Key
Specifies the short name f... |
PowerShellCorpus/GithubGist/guitarrapc_e9ffaf2c584ddfa772da_raw_bcd39a82326f0337c75ae2e2a3df363ebf252597_NetstedOtherFileConfigurationBad.ps1 | guitarrapc_e9ffaf2c584ddfa772da_raw_bcd39a82326f0337c75ae2e2a3df363ebf252597_NetstedOtherFileConfigurationBad.ps1 | # read nested child configuration
Get-ChildItem -Path ChildConfiguration -File | %{ .$_.FullName }
# parent netsted configuraion
Configuraion NetstedConfiguration
{
param
(
[Parameter(Mandatory = 1, Position = 0)]
[string]$Node,
[Parameter(Mandatory = 1, Position = 1)]
... |
PowerShellCorpus/GithubGist/joshtransient_5984704_raw_9194efedbfa654ac37bca566300f97ee9dea8303_Discover-SPFarm.ps1 | joshtransient_5984704_raw_9194efedbfa654ac37bca566300f97ee9dea8303_Discover-SPFarm.ps1 | #REGION Functions
# the following two functions were stolen from:
# mspowershell.blogspot.com/2009/02/t-sql-query-with-object-based-result.html
function ConnectSQL {
Param ($server, $query, $database)
$conn = new-object ('System.Data.SqlClient.SqlConnection')
$conn.ConnectionString = "Server=$serv... |
PowerShellCorpus/GithubGist/tkinz27_8a0b49f3c8b0ea4575c6_raw_0553a03b6d6ee2cb45ebb3a86b6dcf3b4333ecca_file.ps1 | tkinz27_8a0b49f3c8b0ea4575c6_raw_0553a03b6d6ee2cb45ebb3a86b6dcf3b4333ecca_file.ps1 | #!powershell
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribu... |
PowerShellCorpus/GithubGist/proquibas_4634427_raw_147daf48beeb3defa2df875bd4d90435c243af58_AD_power.ps1 | proquibas_4634427_raw_147daf48beeb3defa2df875bd4d90435c243af58_AD_power.ps1 | #############################################################################
# PowerShell para extraer información de Active Directory. #
# Se crea directorio C:\FSO y los outputs se guardan en outcommand.txt #
# Informacion que extrae: #
# >Numero total de usuarios #
# >Numero total de ... |
PowerShellCorpus/GithubGist/sneal_7808621_raw_971e5b9263dd4b59ebe2b2a15a51841eca1faecb_gistfile1.ps1 | sneal_7808621_raw_971e5b9263dd4b59ebe2b2a15a51841eca1faecb_gistfile1.ps1 | $is_64bit = [IntPtr]::size -eq 8
# setup openssh
$ssh_download_url = "http://www.mls-software.com/files/setupssh-6.3p1-1.exe"
if ($is_64bit) {
Write-Host "64 bit OS found"
$ssh_download_url = "http://www.mls-software.com/files/setupssh-6.3p1-1(x64).exe"
}
If (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh... |
PowerShellCorpus/GithubGist/Elindalyne_1790669_raw_0a874461c6791fb17663a0ef84adbe0eb23812d8_Bootstrap-EC2-Windows-CloudInit.ps1 | Elindalyne_1790669_raw_0a874461c6791fb17663a0ef84adbe0eb23812d8_Bootstrap-EC2-Windows-CloudInit.ps1 | # Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install the CloudInit.NET service, 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the insta... |
PowerShellCorpus/GithubGist/fstanley_5621593_raw_4dbebc12eec4db7c3e3bb15118ebccd41bfca87b_nb_makefileBuilder.ps1 | fstanley_5621593_raw_4dbebc12eec4db7c3e3bb15118ebccd41bfca87b_nb_makefileBuilder.ps1 | # Author: Forrest Stanley <fstanley@netburner.com>
#
# This script generates a makefile in the current folder. It automatically adds
# required cpp files and html files/folder.
#
# Usage nb_makefileBuilder
# -Platform [PLATFORM] - optional. Adds Platform = PLATFORM to makefile
#
#
param(
[Paramet... |
PowerShellCorpus/GithubGist/rysstad_9972336_raw_a28faf686c84f510d27f0061c1597dfff2c91ee8_Generate-RandomPassword.ps1 | rysstad_9972336_raw_a28faf686c84f510d27f0061c1597dfff2c91ee8_Generate-RandomPassword.ps1 | ################################################################################
# PowershellGenerateRandomPassword
#
# Description: Generate random password consisting of only upper and lower case letters and numbers.
# Adding non-letter characters would increase the password comp... |
PowerShellCorpus/GithubGist/ziembor_6911450_raw_1f7caa4aaaa5f541de97cacc0bd596931d51f8b4_Remove-DirtyCharacters.ps1 | ziembor_6911450_raw_1f7caa4aaaa5f541de97cacc0bd596931d51f8b4_Remove-DirtyCharacters.ps1 | $SystemWebAssembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Web")
$SystemGlobalizationAssembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Globalization")
$SystemTextAssembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Text")
function Convert-TitleToSlug([String] ... |
PowerShellCorpus/GithubGist/jeffhandley_6312875_raw_6164b4221602ad421a06e55e20a174fc24e969b5_Get-RandomPassword.ps1 | jeffhandley_6312875_raw_6164b4221602ad421a06e55e20a174fc24e969b5_Get-RandomPassword.ps1 | <#
.SYNOPSIS
Returns a random, timestamped, password
#>
# Base64-encode the Guid to add some additional characters
[DateTime]::Now.ToString("MMMddyy") + "!" + [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes([Guid]::NewGuid().ToString()))
|
PowerShellCorpus/GithubGist/y0ug_ceb453ef63de5c681c7a_raw_f3882286565b5e4007fc6d0d7ff8e6aaf3349c61_disable_service.ps1 | y0ug_ceb453ef63de5c681c7a_raw_f3882286565b5e4007fc6d0d7ff8e6aaf3349c61_disable_service.ps1 | $filename = "service_disabled.txt"
foreach ($line in get-content $filename) {
$line = $line.trim()
if($line.StartsWith("#")){ continue }
$elems = $line.split("#")
$srv = $elems[0].trim()
$desc = $elems[1].trim()
write-host "Disabled:" $srv "|" $desc
set-service $srv -startuptype disabled
}
|
PowerShellCorpus/GithubGist/jasongaylord_5672298_raw_851b2f4cdbefd127bc44349381309948b7d41ee2_Get-ADComputerCDRomInfo.ps1 | jasongaylord_5672298_raw_851b2f4cdbefd127bc44349381309948b7d41ee2_Get-ADComputerCDRomInfo.ps1 | Function Get-ADComputerCDRomInfo
{
# Search Active Directory for computers
([adsisearcher]"objectcategory=computer").findall() | ForEach-Object {
# Set computer name
$c = ([adsi]$_.path).Name;
# Function variables
$deviceId = ""
$volumeName = ""
$err = ... |
PowerShellCorpus/GithubGist/ao-zkn_ab4570b0ce00b48c33a7_raw_0fa3b2d9cbe67d37e35057205ce1a41582190d90_Rotate-FileSize.ps1 | ao-zkn_ab4570b0ce00b48c33a7_raw_0fa3b2d9cbe67d37e35057205ce1a41582190d90_Rotate-FileSize.ps1 | # ------------------------------------------------------------------
# ファイルサイズでファイルのローテーションを行う
# 関数名:Rotate-FileSize
# 引数 :FilePath ファイルパス
# :RollingFileSize 最大ファイルサイズ(デフォルト:10MB)
# :MaxBackupIndex 最大バックアップログファイル数(デフォルト:10)
# 戻り値:なし
# ------------------------------------------------------------------
funct... |
PowerShellCorpus/GithubGist/jeffpatton1971_8187557_raw_a02df64e9c3176393e0b92d1aaa703b458bc9515_SetupDSCClient.ps1 | jeffpatton1971_8187557_raw_a02df64e9c3176393e0b92d1aaa703b458bc9515_SetupDSCClient.ps1 | Configuration SetupDSCClient
{
param
(
[string]$NodeId,
[string]$PullServer
)
LocalConfigurationManager
{
AllowModuleOverwrite = 'True'
ConfigurationID = $NodeId
ConfigurationModeFrequencyMins = 30
RefreshFrequencyMins = 15
Configur... |
PowerShellCorpus/GithubGist/devlead_9638825a3380fa473bca_raw_477e5aa8af7d669d855241ff2d2adadabf4c4849_gistfile1.ps1 | devlead_9638825a3380fa473bca_raw_477e5aa8af7d669d855241ff2d2adadabf4c4849_gistfile1.ps1 | gci -Directory -Recurse .git -Hidden|%{pushd;cd (Split-Path -Parent $_);(git remote -v)-split "`n"|%{$r=$_ -split "`t| ";iex "git remote set-url $(if($r[2]-eq"(push)"){"--push "})$($r[0]) $($r[1]-replace ("John","Doe"))"} ;popd}
|
PowerShellCorpus/GithubGist/andreimic_7804746_raw_d894e94952f959a1d696e824a9c13c5c7f6019a1_gistfile1.ps1 | andreimic_7804746_raw_d894e94952f959a1d696e824a9c13c5c7f6019a1_gistfile1.ps1 | # References
# http://www.thesysadminhimself.com/2013/09/sharepoint-start-workflow-all-items-powershell.html
# http://social.technet.microsoft.com/Forums/sharepoint/en-US/dffdceab-f2fe-4886-8e2a-ea26cf08c78a/how-to-start-a-speific-workflow-programatically-in-sharepoint-2010-via-powershell
$web = Get-SPWeb -Identity "... |
PowerShellCorpus/GithubGist/uniquelau_5592800_raw_4f7db2ca2e542fafa1de5686978cdec43e186e5b_createWebsite.ps1 | uniquelau_5592800_raw_4f7db2ca2e542fafa1de5686978cdec43e186e5b_createWebsite.ps1 | <#
.SYNOPSIS CreateWebsite - Automatic website creation.
.DESCRIPTION Allow to create a website and its ApplicationPool. Some tuning is included
.PARAMETER SiteName Defines the display name (in IIS Manager) of the website
Mandatory parameter.
.PARAMETER Port Defines the listening port fo... |
PowerShellCorpus/GithubGist/urasandesu_4f99747caea265a579ec_raw_39a300f4459f665e812cd1ca2b2e0093db40baf2_Invoke-PilotStubber.ps1 | urasandesu_4f99747caea265a579ec_raw_39a300f4459f665e812cd1ca2b2e0093db40baf2_Invoke-PilotStubber.ps1 | [CmdletBinding()]
param (
[string[]]
$ReferenceFrom,
[string]
$Assembly,
[string]
$TargetFrameworkVersion,
[string]
$KeyFile,
[string]
$OutputPath,
[string]
$Settings,
[switch]
$WhatIf
)
# --------------------------------... |
PowerShellCorpus/GithubGist/MyITGuy_9472976_raw_05d6b53ea769c709991de2c4cd30a0637a7aa2a3_smpAutomationEmailCheck.ps1 | MyITGuy_9472976_raw_05d6b53ea769c709991de2c4cd30a0637a7aa2a3_smpAutomationEmailCheck.ps1 | [CmdletBinding(SupportsShouldProcess=$True)]
param (
#SMTP server name
[string]$smtpServer = "smtp",
[string]$From,
#[string]$ReplyTo = "",
[string]$To,
[string]$Cc,
[string]$Subject = "Automation Policies Email Verification",
[switch]$Export
)
Import-Module SQLPS
Import-Module ActiveDirectory
fu... |
PowerShellCorpus/GithubGist/janikvonrotz_6247871_raw_3aa26fe8d437566e113e69cf1af6bce628ba9642_New-ADUsers.ps1 | janikvonrotz_6247871_raw_3aa26fe8d437566e113e69cf1af6bce628ba9642_New-ADUsers.ps1 | <#
$Metadata = @{
Title = "Create new ActiveDirectory users"
Filename = "New-ADUsers.ps1"
Description = ""
Tags = "powershell, activedirectory, user"
Project = ""
Author = "Janik von Rotz"
AuthorContact = "http://janikvonrotz.ch"
CreateDate = "2013-08-16"
LastEditDate = "20... |
PowerShellCorpus/GithubGist/ndelitski_3ce58ffe400882a6338f_raw_7899509b09ca1905726ed06d677c12f4ae2c36e9_vagrant-windows.ps1 | ndelitski_3ce58ffe400882a6338f_raw_7899509b09ca1905726ed06d677c12f4ae2c36e9_vagrant-windows.ps1 | # Powershell Script to prepare the windows install to be used with vagrant-windows
Set-ExecutionPolicy -executionpolicy remotesigned -force
# Step 1: Disable UAC
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -PropertyType DWord -Value 0 -Force | Out-Null
... |
PowerShellCorpus/GithubGist/roberto-reale_4d6a2d32f3b25225decc_raw_d355d0a70b2ae3f91c176a4be529d53575f7c1ea_days_to_christmas.ps1 | roberto-reale_4d6a2d32f3b25225decc_raw_d355d0a70b2ae3f91c176a4be529d53575f7c1ea_days_to_christmas.ps1 | #
# How many days until Christmas?
#
function DaysToXmas()
{
$now = Get-Date
$Xmas = Get-Date -Day 25 -Month 12
if ($now -gt $Xmas) {
$Xmas = Get-Date -Day 25 -Month 12 -Year ($now.Year + 1)
}
$diff = $Xmas.Subtract($now).Days
if ($diff -eq 0) {
Write-Host "Happy Chri... |
PowerShellCorpus/GithubGist/andrewrjones_1600609_raw_98e386d00c752bf54ca37ff03c035b3d0038162a_Microsoft.PowerShell_profile.ps1 | andrewrjones_1600609_raw_98e386d00c752bf54ca37ff03c035b3d0038162a_Microsoft.PowerShell_profile.ps1 | # Import PowerShell Community Extensions
# Available from http://pscx.codeplex.com/
$pscx = Get-Module -List Pscx
if($m){Import-Module Pscx}
Set-Alias open Invoke-Item
Set-Alias vi gvim # because I forget...
function prompt
{
# set the window title to the path
$host.ui.RawUI.WindowTitle = $(get-location)
# cha... |
PowerShellCorpus/GithubGist/PaulDMurphy_08aec7fe6b9b2ec20159_raw_963cc6c983ff3063e98795c9d6aaf315ce07808f_updates.ps1 | PaulDMurphy_08aec7fe6b9b2ec20159_raw_963cc6c983ff3063e98795c9d6aaf315ce07808f_updates.ps1 | # Boxstarter options
$Boxstarter.RebootOk =$true # Allow reboots?
$Boxstarter.AutoLogin =$true # Save my password securely and auto-login after a reboot
$Boxstarter.NoPassword =$false # Is this a machine with no login password?
# Set the execution policy
Update-ExecutionPolicy Unrestricted
# Configure ... |
PowerShellCorpus/GithubGist/jonschoning_1149285_raw_0fca3c000df90fca570cc5b3181079f5fbd59003_Format-Columns.ps1 | jonschoning_1149285_raw_0fca3c000df90fca570cc5b3181079f5fbd59003_Format-Columns.ps1 | function Format-Columns {
################################################################
#.Synopsis
# Formats incoming data to columns.
#.Description
# It works similarly as Format-Wide but it works vertically. Format-Wide outputs
# the data row by row, but Format-Columns outputs them column by column.
#.Pa... |
PowerShellCorpus/GithubGist/victorvogelpoel_6636754_raw_4db7c63089cc50022761d90a99f265ec325a8af5_compare-directory.ps1 | victorvogelpoel_6636754_raw_4db7c63089cc50022761d90a99f265ec325a8af5_compare-directory.ps1 | # Compare-Directory.ps1
# Compare files in one or more directories and return file difference results
# Victor Vogelpoel <victor.vogelpoel@macaw.nl>
# Sept 2013
#
# Disclaimer
# This script is provided AS IS without warranty of any kind. I disclaim all implied warranties including, without limitation,
# any impl... |
PowerShellCorpus/GithubGist/NotMyself_1944957_raw_ae9898129bc470a4d66f8a0113e892063d84f6a6_clean-merged-branches.ps1 | NotMyself_1944957_raw_ae9898129bc470a4d66f8a0113e892063d84f6a6_clean-merged-branches.ps1 | $dontcare = git fetch origin --prune
$branches = git branch -a --merged |
?{$_ -match "remotes\/origin"} |
?{$_ -notmatch "\/master"} |
%{$_.Replace("remotes/origin/", "").Trim() }
if (-not $branches) {
echo "No merged branches detected"
exit 0
}
echo $branches
$title = "Delete Me... |
PowerShellCorpus/GithubGist/glassdfir_a12cbad63fad91ff90d5_raw_9145dfa58ebd91d345b7897d1f95735df9179577_snippet.ps1 | glassdfir_a12cbad63fad91ff90d5_raw_9145dfa58ebd91d345b7897d1f95735df9179577_snippet.ps1 | Param(
[Parameter(Mandatory=$False)]
[String] $Remote ="",
[Parameter(Mandatory=$True)]
[String] $query ="",
[Parameter(Mandatory=$False)]
[Switch] $exact = $false
)
$ComputerName="LocalHost"
If($Remote -ne ""){$ComputerName = $Remote}
If($exact)
{
$searchstring = 'Event[System[Eve... |
PowerShellCorpus/GithubGist/ebibibi_2cf0f4206e94b917e4f1_raw_dc11de790b8b7b93203ac90203802d7d1fd2f3ff_runas.ps1 | ebibibi_2cf0f4206e94b917e4f1_raw_dc11de790b8b7b93203ac90203802d7d1fd2f3ff_runas.ps1 | Param
(
[String]$Path = (Get-Location)
)
# Elevate
Write-Host "Checking for elevation... " -NoNewline
$CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
if (($CurrentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) -eq ... |
PowerShellCorpus/GithubGist/sunnyc7_8617526_raw_dc78e4e52a8d58bfd49b7adac303008f5f0bbbf0_ConvertFrom-IISW3CLog.ps1 | sunnyc7_8617526_raw_dc78e4e52a8d58bfd49b7adac303008f5f0bbbf0_ConvertFrom-IISW3CLog.ps1 | function ConvertFrom-IISW3CLog {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('PSPath')]
[string[]]
$Path
)
process {
foreach ($SinglePath in $Path) {
$FieldNames = $null
... |
PowerShellCorpus/GithubGist/Tylerflick_8459808_raw_a8c51eeaf5cd41989416543740f17ed48764816f_WCF%20Client%20Generator.ps1 | Tylerflick_8459808_raw_a8c51eeaf5cd41989416543740f17ed48764816f_WCF%20Client%20Generator.ps1 | # CHANGE THESE TO COMPLY WITH YOUR LOCAL MACHINE & SERVICE YOU ARE REFERENCING #
$linqPadConfig = 'C:\Program Files (x86)\LINQPad4\linqpad.config'
$linqPadExtensions = 'PATH TO LINQPAD PLUGINS FOLDER'
$servicePath = 'SERVICE PATH'
$generatedCsFile = 'GENERATED SERVICE C# FILE NAME'
################################... |
PowerShellCorpus/GithubGist/janegilring_91f174491e498e170981_raw_e8b2de670931bcfefa384dbca5d9233b58da809b_RoyalTS-PSModule-Examples.ps1 | janegilring_91f174491e498e170981_raw_e8b2de670931bcfefa384dbca5d9233b58da809b_RoyalTS-PSModule-Examples.ps1 | # Import the module
$RTSPSModule = Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath 'code4ward.net\Royal TS V3\RoyalDocument.PowerShell.dll'
Import-Module $RTSPSModule
# Explore available cmdlets
Get-Command -Module RoyalDocument.PowerShell
# Create a new RoyalStore in memory
$Store = New-RoyalStore -UserN... |
PowerShellCorpus/GithubGist/ao-zkn_3e97b82a116418197d26_raw_07bc953acc9a6a5cb8c786b3fbcd53e942c1c40f_ConvertTo-UsedFileName.ps1 | ao-zkn_3e97b82a116418197d26_raw_07bc953acc9a6a5cb8c786b3fbcd53e942c1c40f_ConvertTo-UsedFileName.ps1 | # ------------------------------------------------------------------
# Windowsでファイル名に使用できない禁止文字を全角に変換する
# 関数名:ConvertTo-UsedFileName
# 引数 :FileName ファイル名
# 戻り値:変換後のファイル名
# ------------------------------------------------------------------
function ConvertTo-UsedFileName([String]$FileName){
# 禁止文字(半角記号)
$CannotUse... |
PowerShellCorpus/GithubGist/tekmaven_041a205276bf4d26e8f9_raw_22a7a126973245cb972ef4fe780e30e5cc762402_Install-MongoDb-On-AppVeyor.ps1 | tekmaven_041a205276bf4d26e8f9_raw_22a7a126973245cb972ef4fe780e30e5cc762402_Install-MongoDb-On-AppVeyor.ps1 | #Make sure 7za is installed
choco install 7zip.commandline
# Create mongodb and data directory
md $env:temp\mongo\data
# Go to mongodb dir
Push-Location $env:temp\mongo
# Download zipped mongodb binaries to mongodbdir
Invoke-WebRequest https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.5.zi... |
PowerShellCorpus/GithubGist/botsmack_5878562_raw_dac5e17eca84e11935a0e9ff1169d50f20a666e3_encode.ps1 | botsmack_5878562_raw_dac5e17eca84e11935a0e9ff1169d50f20a666e3_encode.ps1 | <#
I added the optional decomb PowerShell parameter than activates "--decomb" in Handbrake.
I was running into interlace issues encoding an animated TV show - Sealab 2021. I don't
think you will need it unless you're enoding similar content. For everything else I
leave it off ($false) by default.
Improved t... |
PowerShellCorpus/GithubGist/mswietlicki_2369bdb303682ca243fc_raw_a1b1b08c6ee239166fdb8ed2a41b4d6a29d33e30_gistfile1.ps1 | mswietlicki_2369bdb303682ca243fc_raw_a1b1b08c6ee239166fdb8ed2a41b4d6a29d33e30_gistfile1.ps1 | Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
|
PowerShellCorpus/GithubGist/morgansimonsen_8040285_raw_1d8e5bb1337b3e835541be5c8ce53c517ad4a8c4_gistfile1.ps1 | morgansimonsen_8040285_raw_1d8e5bb1337b3e835541be5c8ce53c517ad4a8c4_gistfile1.ps1 | get-qadobject -SearchRoot <canonical name of domain> ´
-ldapFilter '(&(objectClass=group)(mailnickname=*))' ´
-service <DC FQDN> -SizeLimit 0 | Set-QADObject -ObjectAttributes ´
@{adminDisplayName='';´
altRecipient='';´
authOrig='';´
autoReplyMessage='';´
deletedItemFlags='';´
delivContLength='';´
deliverAndRe... |
PowerShellCorpus/GithubGist/forsythetony_3ac8f04fe0af913f23b1_raw_a37d22a605ba5605833ade15d015a126327363fe_newConvertVideos.ps1 | forsythetony_3ac8f04fe0af913f23b1_raw_a37d22a605ba5605833ade15d015a126327363fe_newConvertVideos.ps1 | #
# Function Name: getUserData
#
# Inputs: None
#
# Output:
# -$userData: A dictionary containing the entries...
# - "start" -> A dateTime object that marks the start of the date range
# - "end" -> A dateTime object that marks the end of the date range
# ... |
PowerShellCorpus/GithubGist/sunnyone_7875686_raw_030987783996e86ecf43a67d62733cbc01f111ee_PrintExceptionSecondChance.ps1 | sunnyone_7875686_raw_030987783996e86ecf43a67d62733cbc01f111ee_PrintExceptionSecondChance.ps1 | param($Command)
New-DbgSession -command $Command
Invoke-DbgCommand sxe ld clr
Send-DbgGo # to clr loaded
Load-DbgExtension sos clr # .loadby sos clr
Send-DbgGo # to CorExeMain
Send-DbgGo # to go!
# app crashes
Invoke-DbgCommand "!pe"
Invoke-DbgCommand "!clrstack"
Exit-DbgSession
|
PowerShellCorpus/GithubGist/andyb5051_0380694726d6ade84809_raw_9f2002d73a93f2d7a4ac19f03b178269ea077c91_Boxstarter-Script.ps1 | andyb5051_0380694726d6ade84809_raw_9f2002d73a93f2d7a4ac19f03b178269ea077c91_Boxstarter-Script.ps1 | # http://boxstarter.org/package/url?
# It's nice to be able to browse NuGet files if necessary
cinstm NugetPackageExplorer
# If we're doing web development, we need a few browsers
cinstm google-chrome-x64
cinstm Firefox
# Don't quite know why this is important, but I'll install silverlight... |
PowerShellCorpus/GithubGist/crancker_5040394_raw_a98c5e046b65f2e175fea1a286bb83db5c414360_IPScanner.ps1 | crancker_5040394_raw_a98c5e046b65f2e175fea1a286bb83db5c414360_IPScanner.ps1 | if (test-path ./output.txt){
remove-item ./output.txt
}
$start = read-host "Start IP"
$finish = read-host "End IP"
$ip1 = ([System.Net.IPAddress]$start).GetAddressBytes()
[Array]::Reverse($ip1)
$ip1 = ([System.Net.IPAddress]($ip1 -join '.')).Address
$ip2 = ([System.Net.IPAddress]$finish).GetAddressBytes()
... |
PowerShellCorpus/GithubGist/MattHoneycutt_97342b8f79e1cc378d14_raw_4e30d78dfd65b6952eb1853e91cd6eb4fb60c8b4_gistfile1.ps1 | MattHoneycutt_97342b8f79e1cc378d14_raw_4e30d78dfd65b6952eb1853e91cd6eb4fb60c8b4_gistfile1.ps1 | $StandardGitIgnoreFile = Resolve-Path ".\std.gitignore"
function Git-InitStandard() {
git init .
Copy-Item $StandardGitIgnoreFile ".\.gitignore"
Write-Host "Added standard gitignore file."
}
<#
This assumes you have a file next to your Powershell profile (where this function is defined) named std.gitignore.... |
PowerShellCorpus/GithubGist/sweeneyrobb_6504243_raw_d55369692832a9cf50f6ae31bf2d2103d55d2a89_Select-FileDialog.ps1 | sweeneyrobb_6504243_raw_d55369692832a9cf50f6ae31bf2d2103d55d2a89_Select-FileDialog.ps1 | function Select-FileDialog
{
param([string]$Title, [string]$Directory, [string]$Filter="All Files (*.*)|*.*" )
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$objForm = New-Object System.Windows.Forms.OpenFileDialog
$objForm.InitialDirectory = $Directory
$objForm.Filter... |
PowerShellCorpus/GithubGist/tetsuh_8729123_raw_bdc6b61e6d5b90526d4e78d335c3c7c621846cc9_svnlog2loc.ps1 | tetsuh_8729123_raw_bdc6b61e6d5b90526d4e78d335c3c7c621846cc9_svnlog2loc.ps1 | ######################################################################################
#
# svnlog2loc.ps1
# svnのログを解析し、開発種別を表す特定キーワード別の開発規模(行数)を取得する。
#
# USAGE:
# svnlog2loc.ps1 <リポジトリパス> <開始レビジョン> <終了レビジョン> <出力ファイル>
# 例)
# svnlog2loc.ps1 file:///usr/local/svn/a25Project 2000 HEAD a25_SVN_LOC.csv
#
# Histor... |
PowerShellCorpus/GithubGist/trondhindenes_faeb6c1212f4a3e2457c_raw_83d29d528be052a607a8b45fc571f4de731c3f79_publish-SMAv2.ps1 | trondhindenes_faeb6c1212f4a3e2457c_raw_83d29d528be052a607a8b45fc571f4de731c3f79_publish-SMAv2.ps1 | Function Process-RunbookFolder
{
Param (
$Path,
[switch]$recurse
)
$allwfs = get-childitem -Path $Path -Recurse:$recurse
$Global:referencelist = New-Object System.Collections.ArrayList
[System.Collections.ArrayList]$Global:ToProcessList = $allwfs | select -ExpandProperty ... |
PowerShellCorpus/GithubGist/yan-shuai_d60f3fbec3d17656a7a4_raw_9c70ed2421774aee3c6695a53acf1c2202c5b9e5_basics.ps1 | yan-shuai_d60f3fbec3d17656a7a4_raw_9c70ed2421774aee3c6695a53acf1c2202c5b9e5_basics.ps1 | Clear-Host
Set-Variable -Name var -Value 100 # $var = 100
$var
Get-Variable var
Clear-Variable -Name var
$var
Remove-Variable -Name var
Get-Variable var
"I just want to say 'Hello World', OK? "
"Plural`bsight"
"Plural`nsight" # new line
"Plural`t`nsight"
$heretext = @"
some
som... |
PowerShellCorpus/GithubGist/totomz_4d033fa1b991504a4e31_raw_b1627b2efaacc45f629691e8a5fb9b04a6819b98_gistfile1.ps1 | totomz_4d033fa1b991504a4e31_raw_b1627b2efaacc45f629691e8a5fb9b04a6819b98_gistfile1.ps1 | $gscript = "test-script/startup.ps1";Invoke-Expression $(Invoke-RestMethod -Uri $("https://storage-download.googleapis.com/"+$gscript+"?access_token=" + $($(Invoke-RestMethod -Uri "http://metadata/computeMetadata/v1/instance/service-accounts/default/token" -Headers @{"Metadata-Flavor"="Google"}).access_token)));
|
PowerShellCorpus/GithubGist/lantrix_97bc8f3d494681652ba8_raw_80faea164a66706f944fdd58dfbbf67f7d5b6846_newinstance.ps1 | lantrix_97bc8f3d494681652ba8_raw_80faea164a66706f944fdd58dfbbf67f7d5b6846_newinstance.ps1 | #setup variables
$ami = "ami-e95c31d3" #public Windows server 2012 R2
$subnet = "subnet-e1a4f488" #VPC Subnet for instance
$group = "sg-e5f3e889" #whatever security group
$folder = 'C:\Users\me\OneDrive'
$allVolumesAvailable = $False
$readyCount = 0
$maxRetries = 20
$sleepBetweenChecks = 10
$Retries = 0
#Cr... |
PowerShellCorpus/GithubGist/gpolitis_4349530_raw_53007582e0cf18891335d720263aaa398f2e71bc_Microsoft.PowerShell_profile.ps1 | gpolitis_4349530_raw_53007582e0cf18891335d720263aaa398f2e71bc_Microsoft.PowerShell_profile.ps1 | function emacs
{
&"C:\Program Files (x86)\emacs-24.2\bin\emacs.exe" "-nw" $args
}
function Get-BitsFile
{
Get-BitsTransfer | % {
$_.FileList | % {
New-Object PSObject -Property @{
Progress = ($_.BytesTransferred / $_.BytesTotal)
LocalName = $_.LocalName
}
}
}
}
|
PowerShellCorpus/GithubGist/skoon_1679717_raw_14bcfbfe3800f77ae6233bdfd75c403426ec23ac_githg.ps1 | skoon_1679717_raw_14bcfbfe3800f77ae6233bdfd75c403426ec23ac_githg.ps1 | if (test-path function:\prompt) {
$oldPrompt = ls function: | ? {$_.Name -eq "prompt"}
remove-item -force function:\prompt
}
function prompt {
function getGitStatus {
$branch = git branch 2>&1
if($branch.Exception -eq $null) {
$status = "git"
$branch | foreach {
if ($_ -match "^\*(... |
PowerShellCorpus/GithubGist/ibara1454_a8cf0d3aa013c7f775d8_raw_47de30c76a38f625cbad660b8c4d2b7e8da20138_dump.ps1 | ibara1454_a8cf0d3aa013c7f775d8_raw_47de30c76a38f625cbad660b8c4d2b7e8da20138_dump.ps1 | # Initializing
$root_path = 'I:\' # scanning for what path
$output = '.\Desktop\list.txt' # output path
$pattern = '' # pattern match. ex: '*abc*'
$include_ext = '' # extension name. ex: '*.rar' or '*.txt *.exe'
$query = join-path $root_path $pattern... |
PowerShellCorpus/GithubGist/MattDavies_dfc66ade9c8e481ce854_raw_cad0f58ed8fd4399cecc6198ffa446d4fc9a715d_Publish-WebApplicationVM.ps1 | MattDavies_dfc66ade9c8e481ce854_raw_cad0f58ed8fd4399cecc6198ffa446d4fc9a715d_Publish-WebApplicationVM.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Microsoft Azure Virtual Machine for a Visual Studio web project.
For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394472
.EXAMPLE
PS C:\> .\Publish-WebApplicationVM.ps1 `
-Configuration .\Configurations\WebApplication1-VM... |
PowerShellCorpus/GithubGist/serbrech_8003858_raw_5527525f12a0e46c456a0de7951fddf11b144f61_MsDeploy.ps1 | serbrech_8003858_raw_5527525f12a0e46c456a0de7951fddf11b144f61_MsDeploy.ps1 | function DeployWebsite($Package, $Server, $IISSite, $App, $Username, $Password) {
$MSDeployKey = 'HKLM:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3'
if(!(Test-Path $MSDeployKey)) {
throw "Could not find MSDeploy. Use Web Platform Installer to install the 'Web Deployment Tool' and re-run this command"... |
PowerShellCorpus/GithubGist/ghotz_af65a1d178d8119e325e_raw_bf7356edc512bffa31f236ad345042100921eded_Split-ErrorLog.ps1 | ghotz_af65a1d178d8119e325e_raw_bf7356edc512bffa31f236ad345042100921eded_Split-ErrorLog.ps1 | # just a draft, need massive polishing :)
cls;
$reader = new-object System.IO.StreamReader("ERRORLOG")
$count = 1
$numlines = 0
$fileName = "{0}{1}.{2}" -f ("ERRORLOG_stripped_", $count, "txt")
while(($line = $reader.ReadLine()) -ne $null)
{
if ((++$numlines % 1000) -eq 0) { Write-Output "Processed $numlines... |
PowerShellCorpus/GithubGist/ao-zkn_47b3f28d1bf1c5e6543d_raw_d3e29a5c7355ba78850aa357e85e9931f33bd5a1_Rename-Folder.ps1 | ao-zkn_47b3f28d1bf1c5e6543d_raw_d3e29a5c7355ba78850aa357e85e9931f33bd5a1_Rename-Folder.ps1 | # ------------------------------------------------------------------
# フォルダ名をリネームする
# 関数名:Rename-Folder
# 引数 :FolderPath 名前を変更するフォルダパス
# :NewFolderName 新しいフォルダ名前
# 戻り値:なし
# ------------------------------------------------------------------
function Rename-Folder([String]$FolderPath, [String]$NewFolderName){
if... |
PowerShellCorpus/GithubGist/BrandonBrowning_935043e4f54942fbba34_raw_8c05f45fd1423f3e756a395a39f3bb87bc7fad07_gistfile1.ps1 | BrandonBrowning_935043e4f54942fbba34_raw_8c05f45fd1423f3e756a395a39f3bb87bc7fad07_gistfile1.ps1 | # pk: pk - Azure Table Storage Log Partition Key Generator
# by Brandon Browning
#
# Usage: pk [time-expression]...
# Time expression examples: +5s, -1h15s, 30m
# Examples:
# pk # Gets current time keys
# pk -30s # Gets time keys 30 seconds ago
# pk 0s -1h5s # Gets time keys now, and 1 h... |
PowerShellCorpus/GithubGist/pogin503_d5cf1397db243b26b6cf_raw_4afb234bf5dac93409f711886186af96e61e6095_ps1.ps1 | pogin503_d5cf1397db243b26b6cf_raw_4afb234bf5dac93409f711886186af96e61e6095_ps1.ps1 | Get-Alias dir # エイリアスを作る
Get-Command # コマンドを表示
Import-Alias c:\scripts\alias.txt
Write-Host # いわゆるprint文
get-content "パス"
Get-Service # 実行中のサービスを表示
# アプリケーション イベントログの最新15個のエントリを表示
Get-EventLog -logName Application -newest 15
# 通常の配列に関してもパイプラインを使用可能。
# 重複を取り除き、ソートをかける
@(3,5,10,1,2,1,1,1,2,6,4,4)|Sort-O... |
PowerShellCorpus/GithubGist/talatham_5774395_raw_73fb8a83e1281d9b2dfcbcd2c6e798240b94d09e_checkmachineforhotfix.ps1 | talatham_5774395_raw_73fb8a83e1281d9b2dfcbcd2c6e798240b94d09e_checkmachineforhotfix.ps1 | # Check for a specific patch on remote PCs v1.2
# Tom Latham 04/02/2010
#
# Added v1.1: Error messaages
# Added v1.2: GUI Inputs
# Function to open file dialog box and select a file
Function Get-FileName($initialDirectory)
{
[void][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms"... |
PowerShellCorpus/GithubGist/fr0gger03_ab5eced3c44f56cf611f_raw_bf757df133bad679a7895702bdc717074e95904a_VMFS-to-LUN-NAA.ps1 | fr0gger03_ab5eced3c44f56cf611f_raw_bf757df133bad679a7895702bdc717074e95904a_VMFS-to-LUN-NAA.ps1 | # you must connect and authenticate to a vCenter server
# use Connect-VIServer to do so
# establish Export file name
$csvname = Read-Host 'Please provide the file path and name for your CSV export'
# Gather information on all datastores in the vCenter and enter a loop
get-datastore |foreach-object {
# Captu... |
PowerShellCorpus/GithubGist/tjchaplin_621edccbfddc0d3526b5_raw_a39878becce7f01e68e07326586fb3c8d01d4645_gistfile1.ps1 | tjchaplin_621edccbfddc0d3526b5_raw_a39878becce7f01e68e07326586fb3c8d01d4645_gistfile1.ps1 | # These are project build parameters in TeamCity
# Depending on the branch, we will use different major/minor versions
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$json = Get-Content "package.json" | Out-String
$o... |
PowerShellCorpus/GithubGist/rheid_8dd79207a84212773869_raw_f420bdd523b5a6d2eb7ed6682ddd02ffbbfea72e_AddFarmAdmin.ps1 | rheid_8dd79207a84212773869_raw_f420bdd523b5a6d2eb7ed6682ddd02ffbbfea72e_AddFarmAdmin.ps1 | #################################################
# Add a new Farm Administrator
#################################################
Add-PSSnapin *SharePoint* -erroraction SilentlyContinue
Write-Host
$newFarmAdmin = Read-Host -Prompt 'Enter the new Farm Administrator (i.e. DOMAIN\Username): '
Write-Host
$webApp = ... |
PowerShellCorpus/GithubGist/rheid_93fad58069b1a62e786b_raw_e1b04af315fbc45672ab661c308fff6a66e95d39_StateService.ps1 | rheid_93fad58069b1a62e786b_raw_e1b04af315fbc45672ab661c308fff6a66e95d39_StateService.ps1 | # The State Service is required in order to use the out-of-the-box workflows in
# SharePoint Server 2010 (e.g. Approval - SharePoint 2010) or any other features
# that leverage InfoPath Forms Services.
#
# When using the Farm Configuration Wizard to configure the State Service, the
# resulting database is named St... |
PowerShellCorpus/GithubGist/andreaslekis_ca65f6471883c43c2c4c_raw_ed5d610721d3a013719ae6197254e8bd21c50550_LpW_Server.ps1 | andreaslekis_ca65f6471883c43c2c4c_raw_ed5d610721d3a013719ae6197254e8bd21c50550_LpW_Server.ps1 | Disable-MicrosoftUpdate
Update-ExecutionPolicy Unrestricted
# Vypne rozsirene zabezpeceni IE
Disable-InternetExplorerESC
cinst notepadplusplus.install
cinst 7zip.install
cinst putty
cinst freecommander
#cinst classic-shell
choco teamviewer.host
# cinst procdump
#Prodiskutovat
#Add-WindowsFeature NET-framework-core... |
PowerShellCorpus/GithubGist/pstephens_7460763_raw_5767cb84a78059d578aa2df45cc6bd27bddaada5_GetNode.ps1 | pstephens_7460763_raw_5767cb84a78059d578aa2df45cc6bd27bddaada5_GetNode.ps1 | $nodeUrl = "http://nodejs.org/dist/v0.10.22/x64/node-v0.10.22-x64.msi"
$nodeSha = "c3c169304c6371ee7bd119151bcbced61a322394"
function DownloadIt($url, $path)
{
Start-BitsTransfer -Source $url -Destination $path
}
function TestHash($path, $sha)
{
$bytes = [System.IO.File]::ReadAllBytes($path)
... |
PowerShellCorpus/GithubGist/vermorel_9804025_raw_014fdb986e1dbcdb33ff34feac3c38a4e1025c00_sample-content.ps1 | vermorel_9804025_raw_014fdb986e1dbcdb33ff34feac3c38a4e1025c00_sample-content.ps1 | # Sample-Content
# By Joannes Vermorel, 2014
# Keep only 1 line out of N of a flat file
# Usage: sample-content .\myfile.csv 100
function Sample-Content()
{
param
(
[string]$path = $null,
[int]$ratio = 100
);
$path = (get-item $path).FullName;
$outpath = $path + ".sample";
$count ... |
PowerShellCorpus/GithubGist/jpoehls_2726969_raw_6b01dc04afdbbda64c730b2e4ffdfacb9fa9760f_xpath-example.ps1 | jpoehls_2726969_raw_6b01dc04afdbbda64c730b2e4ffdfacb9fa9760f_xpath-example.ps1 | function Edit-XmlNodes {
param (
[xml] $doc = $(throw "doc is a required parameter"),
[string] $xpath = $(throw "xpath is a required parameter"),
[string] $value = $(throw "value is a required parameter"),
[bool] $condition = $true
)
if ($condition -eq $true) {
$nodes = $doc.Sele... |
PowerShellCorpus/GithubGist/sesstreets_24d0c9da9e9195803e1b_raw_f86f26502c90b70f6bb85f5ee43365d683509987_DesktopWipe.ps1 | sesstreets_24d0c9da9e9195803e1b_raw_f86f26502c90b70f6bb85f5ee43365d683509987_DesktopWipe.ps1 | DesktopWipe.ps1
# Desktop Wipe version .3
# Moved to powershell
# Better program flow
# Set the user
$strUser="andrewliebowitz.ad"
Get-ChildItem -Force "C:\Users\$strUser\desktop" | ForEach-Object {$_} {remove-item $_.fullname -exclude *.lnk,*.ini -recurse}
|
PowerShellCorpus/GithubGist/altrive_8625656_raw_6acfc5583ca5a39616971523065404fcefef0d0b_ParallelPing.ps1 | altrive_8625656_raw_6acfc5583ca5a39616971523065404fcefef0d0b_ParallelPing.ps1 | function Main
{
$ipAddresses = 1..254 | foreach { "192.168.0.$_" }
#$ipAddresses | Invoke-ParallelPing | Out-GridView
Invoke-ParallelPing -ComputerName $ipAddresses | Out-GridView
}
function Invoke-ParallelPing
{
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[... |
PowerShellCorpus/GithubGist/antonioj-mattos_4a5fbab6534e47cfe348_raw_ad321c2da0231b438260ad8a9bf516a1e0be7d6f_Install-MongoDb-On-AppVeyor.ps1 | antonioj-mattos_4a5fbab6534e47cfe348_raw_ad321c2da0231b438260ad8a9bf516a1e0be7d6f_Install-MongoDb-On-AppVeyor.ps1 | #Make sure 7za is installed
choco install 7zip.commandline
# Create mongodb and data directory
md $env:temp\mongo\data
# Go to mongodb dir
Push-Location $env:temp\mongo
# Download zipped mongodb binaries to mongodbdir
Invoke-WebRequest https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.7.zip?_ga=1.44958753.4466... |
PowerShellCorpus/GithubGist/janegilring_5626326_raw_74107d594f14f768d2d65ea62fc91cae098e9254_2013SGEvent4BeginnerSample.ps1 | janegilring_5626326_raw_74107d594f14f768d2d65ea62fc91cae098e9254_2013SGEvent4BeginnerSample.ps1 | <#
.SYNOPSIS
This will export info on 20 randomly selected AD users to an html
file located on the desktop of the user running it.
It will provide the username, department, title, last logon time,
last password change and account enabled / lockout status sorted by user.
***Notes***
... |
PowerShellCorpus/GithubGist/michelc_a63cbb9f400ad1525288_raw_3189a3d2f266f10744988a6e432a568b0638c37c_Microsoft.PowerShell_profile.ps1 | michelc_a63cbb9f400ad1525288_raw_3189a3d2f266f10744988a6e432a568b0638c37c_Microsoft.PowerShell_profile.ps1 | # Update with PowerShell:
# PS> notepad $profile
# Use Git and Posh-Git from GitHub for Windows
# Source: http://blog.somewhatabstract.com/2014/09/01/getting-posh-git-in-all-your-powershell-consoles-using-github-for-windows/
# Add paths for Git and Posh-Git from GitHub for Windows
# - (git)\cmd => gives acce... |
PowerShellCorpus/GithubGist/gravejester_1c9e354ff726d6d78ae2_raw_6ea816b626b6bfa6fd250a42eb9089917b738238_Write-PluralString.ps1 | gravejester_1c9e354ff726d6d78ae2_raw_6ea816b626b6bfa6fd250a42eb9089917b738238_Write-PluralString.ps1 | function Write-PluralString{
<#
.SYNOPSIS
Write string with built-in handling of plural-s for variable integer.
.DESCRIPTION
Write string with built-in handling of plural-s for variable integer.
.EXAMPLE
Write-PluralString "$($computer): " $num 'file' 'processed'
.EXAMPLE
Write-Verbo... |
PowerShellCorpus/GithubGist/jstangroome_1440889_raw_f398b09019eb3d902d336a8207692f65f716740d_Set-AssemblyInfoVersion.ps1 | jstangroome_1440889_raw_f398b09019eb3d902d336a8207692f65f716740d_Set-AssemblyInfoVersion.ps1 | $NewVersion = '10.1.2.3'
Get-ChildItem -Include assemblyinfo.cs, assemblyinfo.vb -Recurse |
ForEach-Object {
$_.IsReadOnly = $false
(Get-Content -Path $_) -replace '(?<=Assembly(?:File)?Version\(")[^"]*(?="\))', $NewVersion |
Set-Content -Path $_
}
|
PowerShellCorpus/GithubGist/jeffpatton1971_8187784_raw_f5ba8b691979ed3b477c299410e1d795ebe4c6db_AddDSCService.ps1 | jeffpatton1971_8187784_raw_f5ba8b691979ed3b477c299410e1d795ebe4c6db_AddDSCService.ps1 | Configuration DSCPullServer
{
param
(
[string]$ComputerName
)
Node $ComputerName
{
WindowsFeature DSCService
{
Name = "DSC-Service"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
}
}
|
PowerShellCorpus/GithubGist/vladan-m_1c3e382effa993f00d36_raw_ef2f8063e44b7ca713e92bba939d8ff75b94d447_mac-hidden-files.ps1 | vladan-m_1c3e382effa993f00d36_raw_ef2f8063e44b7ca713e92bba939d8ff75b94d447_mac-hidden-files.ps1 | # Run Terminal and enter this command. It's for showing hidden files:
defaults write com.apple.finder AppleShowAllFiles YES
# You must relaunch the Finder by killing it, this is how the changes take effect:
killAll Finder
# If you want to hide hidden files (those preceded with a .) and go back to the default Ma... |
PowerShellCorpus/GithubGist/AmrEldib_de4e018fe11a98b42a18_raw_3cf900d1d2e9fabb5d88d8271a87021401fb0c85_Get-SqlServiceStatus.ps1 | AmrEldib_de4e018fe11a98b42a18_raw_3cf900d1d2e9fabb5d88d8271a87021401fb0c85_Get-SqlServiceStatus.ps1 | function Get-SqlServiceStatus ($serviceName)
{
# Get a reference to the service
$sqlService = Get-Service $serviceName
# Return the service status
return $sqlService.status
} |
PowerShellCorpus/GithubGist/kujotx_6902269_raw_c1aa9c9cb616c6981e41b33c44d40da0c2628733_Chocolatey-Vs2010-Devbox.ps1 | kujotx_6902269_raw_c1aa9c9cb616c6981e41b33c44d40da0c2628733_Chocolatey-Vs2010-Devbox.ps1 | choco windowsfeatures MSMQ-Container
choco windowsfeatures MSMQ-Server
choco install Firefox
choco install Google.Chrome
choco install webpicommandline
choco webpi msdeploy
choco webpi iisexpress
choco install TeraCopy
choco install windbg
choco install windowstelnet
choco install wireshark
choco insta... |
PowerShellCorpus/GithubGist/sheeeng_7235195_raw_35049a2c2c3763fc2aa2f245b0b4cbed570d7d0d_GetDependencyWalker.ps1 | sheeeng_7235195_raw_35049a2c2c3763fc2aa2f245b0b4cbed570d7d0d_GetDependencyWalker.ps1 | ########################################################################
# File : GetDependencyWalker.ps1
# Version : 1.0.0
# Purpose : Downloads the Dependency Walker tool.
# Synopsis: http://www.dependencywalker.com/
# Usage : .\GetDependencyWalker.ps1 ("x86","x64","ia64","32","64")
# Author: Leonard Lee <sheee... |
PowerShellCorpus/GithubGist/AaronOnTheHub_459a93f979ee6e9e137a_raw_faad997afaac3a6d86e8f08e82397ad846b50a04_Log.ps1 | AaronOnTheHub_459a93f979ee6e9e137a_raw_faad997afaac3a6d86e8f08e82397ad846b50a04_Log.ps1 | ##############################################################################
#.SYNOPSIS
# Writes some text, with bonus infoz!
#
#.DESCRIPTION
# Before each line, includes the date and time. Useful for getting coffee and
# seeing how long something took. Hah.
#
#.PARAMETER output
# The text to write. Out. Why is call... |
PowerShellCorpus/GithubGist/pkirch_3da0bec11b5ea037185e_raw_1b28fbbdcebaa135d9062a529c6a5f0eac9713e9_Get-SubscriptionEndpoints3.ps1 | pkirch_3da0bec11b5ea037185e_raw_1b28fbbdcebaa135d9062a529c6a5f0eac9713e9_Get-SubscriptionEndpoints3.ps1 | # Get all Azure VMs in the current subscription.
Get-AzureVM | ForEach-Object {
# Save the current VM for use in the nested ForEach.
$vm = $_
# Get all endpoints of the current VM.
$endpoints = Get-AzureEndpoint -VM $vm
# Iterate all endpoints of the current VM.
$output = $endpoints | For... |
PowerShellCorpus/GithubGist/vScripter_add54f2af5c16c1f1d56_raw_416c44c29ff3a001afc94c4411c5e9d21b6b52b9_Get-NetStat.ps1 | vScripter_add54f2af5c16c1f1d56_raw_416c44c29ff3a001afc94c4411c5e9d21b6b52b9_Get-NetStat.ps1 | function Get-NetStat
{
<#
.SYNOPSIS
This function will get the output of netstat -n and parse the output
.DESCRIPTION
This function will get the output of netstat -n and parse the output.
Credit goes to PowerShell MVP Francois-Xavier Cat, who wrote the orignial function to parse the output of n... |
PowerShellCorpus/GithubGist/guitarrapc_3d52bab84734149ffba8_raw_f59f028b875ecb00bad9c6eeaa27188f79b9e78d_ConfigrationWithoutConfiguraionData.ps1 | guitarrapc_3d52bab84734149ffba8_raw_f59f028b875ecb00bad9c6eeaa27188f79b9e78d_ConfigrationWithoutConfiguraionData.ps1 | # コンフィグレーション (あるべき状態)
Configuration Service
{
param
(
[Parameter(Mandatory = 0)]
[ValidateNotNullOrEmpty()]
[string]$Role = "web"
)
$service = $Allnodes.Where{$_.Role -eq $Role}.Service
$state = "Running"
$startupType = "Automatic"
Node $Allnodes.Where... |
PowerShellCorpus/GithubGist/guitarrapc_43c8fb9f930bbcca3c16_raw_1308f631ef8b90f025936b64b94bc1068dbef225_cDonwloadConfigurationSample.ps1 | guitarrapc_43c8fb9f930bbcca3c16_raw_1308f631ef8b90f025936b64b94bc1068dbef225_cDonwloadConfigurationSample.ps1 | configuration DownloadGitHubRawContent
{
Import-DscResource -ModuleName GraniResource
cDownload hoge
{
DestinationPath = "C:\Tools\README.md"
Uri = "https://raw.githubusercontent.com/guitarrapc/DSCResources/master/README.md"
}
}
DownloadGitHubRawContent
Start-DscConfiguration... |
PowerShellCorpus/GithubGist/mhornfeck_ca67016a3ce77c429a0a_raw_fab811d7ce1a92fa104b7e3c58a129434aca98e6_gistfile1.ps1 | mhornfeck_ca67016a3ce77c429a0a_raw_fab811d7ce1a92fa104b7e3c58a129434aca98e6_gistfile1.ps1 | Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst Microsoft-Hyper-V-All -source windowsFeatures
cinst IIS-WebServerRole -source windowsfeatures
# Browsers
cinstm GoogleChrome
cinstm Firefox
# Runtimes
cinstm Silv... |
PowerShellCorpus/GithubGist/chriseyre2000_f8ddea2acbc6df9a28d8_raw_69eaa7de6403ba97560ca4358881ce0114f8f3a7_powershell-web-server.ps1 | chriseyre2000_f8ddea2acbc6df9a28d8_raw_69eaa7de6403ba97560ca4358881ce0114f8f3a7_powershell-web-server.ps1 | function Load-Packages
{
param ([string] $directory = 'Packages')
$assemblies = Get-ChildItem $directory -Recurse -Filter '*.dll' | Select -Expand FullName
foreach ($assembly in $assemblies) { [System.Reflection.Assembly]::LoadFrom($assembly) }
}
Load-Packages
$routes = @{
"/ola" = { return ... |
PowerShellCorpus/GithubGist/FrankDeGroot_144016341fb00e19b969_raw_5aace9a1208c353346ac26deb0f44add98003bad_Parameters.ps1 | FrankDeGroot_144016341fb00e19b969_raw_5aace9a1208c353346ac26deb0f44add98003bad_Parameters.ps1 | $environment = 'dev' # 'dev', 'test' or 'production'
$packagesDir = 'C:\Users\Administrator\Downloads\_PublishedWebsites'
$siteDir = 'C:\inetpub\wwwroot'
$domain = switch ($environment) { 'dev' { (Get-ChildItem ENV:computername).Value } default { 'OFFICE' } }
$sqlServerInstance = '.'
$reportServerUrl = 'http://rsb... |
PowerShellCorpus/GithubGist/omidkrad_fbb4bfb3b1f5b83c9898_raw_412ad101d527addc84ed474b65c5cc762ea59193_ExecJavaScript.ps1 | omidkrad_fbb4bfb3b1f5b83c9898_raw_412ad101d527addc84ed474b65c5cc762ea59193_ExecJavaScript.ps1 | # some web page with jQuery in it
$url = "http://jquery.com/"
Function ResetTimer
{
$script:startTime = [DateTime]::Now
}
Function IsTimeout([TimeSpan]$timeout)
{
return ([DateTime]::Now - $startTime) -ge $timeout
}
Function WaitForIE
{
$ie = $script:ie
Write-Debug "Waiting..."
R... |
PowerShellCorpus/GithubGist/bewilcox_7105046_raw_5e02ca60fcdd473634eb2547fd2652d0ce66d47f_gistfile1.ps1 | bewilcox_7105046_raw_5e02ca60fcdd473634eb2547fd2652d0ce66d47f_gistfile1.ps1 | #!/bin/bash
export VERTX_MOD_NAME=<mod-name>
PATH="${OPENSHIFT_DATA_DIR}vert.x-2.0.2-final/bin:${OPENSHIFT_DATA_DIR}jdk1.7.0_45/bin:$PATH"
JAVA_HOME="${OPENSHIFT_DATA_DIR}jdk1.7.0_45"
cd ${OPENSHIFT_DATA_DIR}mods
nohup bash -c "exec 'vertx' 'runmod' ${VERTX_MOD_NAME} '-cd ./'${VERTX_MOD_NAME} &> ${OPENSH... |
PowerShellCorpus/GithubGist/matiasherranz-santex_9785941_raw_6815ecea70ede8efca6b5533af6323064a3e04c7_gistfile1.ps1 | matiasherranz-santex_9785941_raw_6815ecea70ede8efca6b5533af6323064a3e04c7_gistfile1.ps1 | $ git init
|
PowerShellCorpus/GithubGist/altrive_6487560_raw_cfc0233adbd59cad4208e586b5c29a1ead60395e_Install-PSModule.ps1 | altrive_6487560_raw_cfc0233adbd59cad4208e586b5c29a1ead60395e_Install-PSModule.ps1 | function Install-PSModule
{
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string] $ModuleName,
[Parameter(Mandatory,ParameterSetName="Local")]
[string] $Path,
[ValidateSet("User","System","ProgramFiles","Local")]
[string] $Target = "User"
)
$ErrorActionPreference = "Stop"
Set-StrictMo... |
PowerShellCorpus/GithubGist/talatham_5765869_raw_a19c339cc95919630aa1bb5b5f62c7ca46ae4ea3_listupdates.ps1 | talatham_5765869_raw_a19c339cc95919630aa1bb5b5f62c7ca46ae4ea3_listupdates.ps1 | $Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$HistoryCount = $Searcher.GetTotalHistoryCount()
$Searcher.QueryHistory(1,$HistoryCount) |
Select-Object Date, Title, Description
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.