full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/GithubGist/sheeeng_6932419_raw_c0f8e966aee07bd19e6e820960897b9cd6cfec98_ListGUIDs.ps1 | sheeeng_6932419_raw_c0f8e966aee07bd19e6e820960897b9cd6cfec98_ListGUIDs.ps1 | ########################################################################
# File : ListGUIDs.ps1
# Version : 1.0.0
# Purpose : List globally unique identifier (GUID) of programs installed.
# Synopsis:
# Usage : .\ListGUIDs.ps1
# Author: Leonard Lee <sheeeng@gmail.com>
############################################... |
PowerShellCorpus/GithubGist/Dan1el42_970e1d43b69baa9dfdfe_raw_55eb98f6b06c79f7eb993c0988003c1de90735f9_Copy-ActiveSMSEncryptionCertificate.ps1 | Dan1el42_970e1d43b69baa9dfdfe_raw_55eb98f6b06c79f7eb993c0988003c1de90735f9_Copy-ActiveSMSEncryptionCertificate.ps1 | <#
.SYNOPSIS
Copy the active SMS encryption certificate to the My store
.DESCRIPTION
Copy the active SMS encryption certificate to the My store to enable access to the private key for the DSC Local Configuration Manager to decrypt credentials
#>
Param
(
[String] $SMSCertificateFriendlyName = 'SMS En... |
PowerShellCorpus/GithubGist/andreagx_9067652_raw_e41a9d42848b8ada100ffab3fce82212bce3e800_Signature1_2.ps1 | andreagx_9067652_raw_e41a9d42848b8ada100ffab3fce82212bce3e800_Signature1_2.ps1 | ###########################################################################”
# AUTHOR: Jan Egil Ring
# Modifications by Darren Kattan
#
# COMMENT: Script to create an Outlook signature based on user information from Active Directory.
# Adjust the variables in the “Custom variables”-section
# Create an Outlook-sig... |
PowerShellCorpus/GithubGist/peaeater_9650933_raw_7d43a32e5695d68a7dc5fb9a17a27d526fd7530e_raw-ia.ps1 | peaeater_9650933_raw_7d43a32e5695d68a7dc5fb9a17a27d526fd7530e_raw-ia.ps1 | # processes Internet Archive packages, producing per page: 1 txt, 1 ocrxml, 1 jpg
# requires djvulibre, imagemagick
param(
[string]$indir = ".",
[string]$outbase = $indir
)
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
function WebSafe([string]$s) {
return $s.T... |
PowerShellCorpus/GithubGist/brunomlopes_165857_raw_07fd19d556d2d4c6863e4ddf6e78b0cbe8a97f2d_archive_downloads.ps1 | brunomlopes_165857_raw_07fd19d556d2d4c6863e4ddf6e78b0cbe8a97f2d_archive_downloads.ps1 | $base_downloads_dir = "S:\downloads\"
$base_archive_dir = "S:\downloads\archive"
if(-not (Test-Path $base_archive_dir)) {
[void] (mkdir $base_archive_dir)
}
$to_archive_files = get-childitem $base_downloads_dir | ? { $_.Name -ne "archive" -and $_.CreationTime -lt (Get-Date).AddDays(-1) }
foreach($to_arc... |
PowerShellCorpus/GithubGist/pohatu_7031323_raw_6e7a2fe63c6f2f269ea8f62548a039e9681c5687_RockPaperScissors.ps1 | pohatu_7031323_raw_6e7a2fe63c6f2f269ea8f62548a039e9681c5687_RockPaperScissors.ps1 | # A simple Rock, Paper Scissors Game in Powershell by pohatu
# Uses very cool Select-Item function by James O'Neill
# Presented here: http://blogs.technet.com/b/jamesone/archive/2009/06/24/how-to-get-user-input-more-nicely-in-powershell.aspx
#
# Also uses a clever trick to make remainder act like modulo for negativ... |
PowerShellCorpus/GithubGist/pjmagee_5659973_raw_990df12fe852523ea6946a8754c5e7c961073df5_creationdate.ps1 | pjmagee_5659973_raw_990df12fe852523ea6946a8754c5e7c961073df5_creationdate.ps1 | # sets the folder creation date to the specified date variable
# version 0.0.1
# author: Patrick Magee
#######################
$choice = ""
$dir = ""
$date = [datetime]::Today
while ($choice -notmatch "[y|n]") {
$choice = Read-Host "Set creation date? (Y/N)"
if($choice -eq "y") {
whi... |
PowerShellCorpus/GithubGist/mattiasblixt_6907923_raw_34506c2336156f3a144ad443ea169079135f7c6b_mine_v131009.ps1 | mattiasblixt_6907923_raw_34506c2336156f3a144ad443ea169079135f7c6b_mine_v131009.ps1 | # http://soumya.wordpress.com/category/powershell/
function Get-LogDate{
$part1 = get-date -Uformat %Y%m%d
$part2 = Get-Date -UFormat %H:%M:%S
write-output $part1" "$part2
}
function Get-LatestBuild{
param(
[string]$Path,
[PSCredential]$Credentials
)
New-PSDrive -Name R -... |
PowerShellCorpus/GithubGist/IISResetMe_8917e9f47226044042f5_raw_3c376040516076199b5de33b05decb32af260b75_Find-OrphanGPTemplates.ps1 | IISResetMe_8917e9f47226044042f5_raw_3c376040516076199b5de33b05decb32af260b75_Find-OrphanGPTemplates.ps1 | gci "\\$(($d=$env:USERDNSDOMAIN))\sysvol\$d\Policies"|?{$_.Name-imatch"^(?<g>\{[A-F\d]{8}(-[A-F\d]{4}){3}-[A-F\d]{12}\})$"}|?{[ADSI]::Exists("LDAP://CN=$($Matched["g"]),CN=Policies,CN=System,DC=$($d-split"\."-join",DC=")")}|%{"{0} is an orphan, remove it"-f$_.FullName}
|
PowerShellCorpus/GithubGist/crmckenzie_4004375_raw_010a924cdac30fe2a9050889cd844336ee4fd6a5_gistfile1.ps1 | crmckenzie_4004375_raw_010a924cdac30fe2a9050889cd844336ee4fd6a5_gistfile1.ps1 | <#
.SYNOPSIS
IlMerges an assembly with its dependencies. Depends on nuget being installed in the PATH.
.PARAMETER targetProject
The name of the project to be ilmerged
.PARAMETER outputAssembly
The name of the ilmerged assembly when it is created
.PARAMETER buildConfiguration
The build configuration used t... |
PowerShellCorpus/GithubGist/t-mat_8771347_raw_7e40d33fd6b2d64c5278b64a995d0d80d598bc66_keyrate.ps1 | t-mat_8771347_raw_7e40d33fd6b2d64c5278b64a995d0d80d598bc66_keyrate.ps1 | <# /*
How can I increase the key repeat rate beyond the OS's limit?
http://stackoverflow.com/a/11056655
*/ #>
Add-Type -Type @"
//"
using System;
using System.Runtime.InteropServices;
namespace MyPrivateKeyRateSettings {
public static class KeyRate {
[DllImport("user32.dll", SetLastError... |
PowerShellCorpus/GithubGist/askesian_2245880_raw_59608a104bb55b443190efd0ac43dfdc95821cf7_Get-SpecialPath.ps1 | askesian_2245880_raw_59608a104bb55b443190efd0ac43dfdc95821cf7_Get-SpecialPath.ps1 | # STEP 0: Declare input parameter
Param([switch]$AsDrive)
# STEP 1: Define hash for paths
$csidl = @{
"Personal" = 0x0005;
"LocalAppData" = 0x001c;
"InternetCache" = 0x0020;
"Cookies" = 0x0021;
"History" = 0x0022;
"Windows" = 0x0024;
"System" = 0x0025;
"ProgramFiles" = 0x0026;
"Prog... |
PowerShellCorpus/GithubGist/flakshack_950175_raw_e840d1640c9845198100c17c9b305d00fd2ea9e7_Start-SuspendedMoveRequests.ps1 | flakshack_950175_raw_e840d1640c9845198100c17c9b305d00fd2ea9e7_Start-SuspendedMoveRequests.ps1 | #############################################################################
# Procedure: Start-SuspendedMoveRequests.PS1
# Author: Scott Vintinner
# Last Edit: 4/30/2011
# Purpose: This script will start a move request in suspended mode and
... |
PowerShellCorpus/GithubGist/jlattimer_95b4fe9d1913de018922_raw_4c18cc5aefdd1dded0ecbaf51b3c0f8accca3c93_Create%20CRM%20VM%20Static%20IP%20Existing.ps1 | jlattimer_95b4fe9d1913de018922_raw_4c18cc5aefdd1dded0ecbaf51b3c0f8accca3c93_Create%20CRM%20VM%20Static%20IP%20Existing.ps1 | <# Make sure you have installed the Azure PowerShell cmdlets: https://www.windowsazure.com/en-us/manage/downloads/ and then reboot #>
<# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The steps need to be run individually
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #>
<# Step 1: Run this first to download your publi... |
PowerShellCorpus/GithubGist/jonschoning_1149228_raw_a665c6ad6ceb7fb1aa1a782d63d3f24a4a57b9a8_Visit-AllFiles.ps1 | jonschoning_1149228_raw_a665c6ad6ceb7fb1aa1a782d63d3f24a4a57b9a8_Visit-AllFiles.ps1 | # Calling Excel Math Functions From PowerShell
$xl = New-Object -ComObject Excel.Application
$xlprocess = Get-Process excel
$worksheet_function = $xl.WorksheetFunction
$data = 1,2,3,4
$matrix = ((1,2,3),(4,5,6),(7,8,10))
Write-Host -ForegroundColor green Median
Write-Host -ForegroundColor red $w... |
PowerShellCorpus/GithubGist/breezhang_7153304_raw_00737553cc03fa3fb214ab1ef00d91a2b9325437_a.ps1 | breezhang_7153304_raw_00737553cc03fa3fb214ab1ef00d91a2b9325437_a.ps1 | #find -type f |xargs md5sum --binary >file.txt
$db = New-Object -TypeName System.Collections.Specialized.NameValueCollection;
foreach($item in (gc 'path\file.txt')){
$temp = $item.Split("*");
$db.add([string]$temp[0],[string]$temp[1]);
}
;
$Global:result=$db.AllKeys | %{ if($db[$_].Split(","... |
PowerShellCorpus/GithubGist/axefrog_6a035b69e710f8315c24_raw_9012ec39c8d4d0c686b643cfae96beec378aeaac_build.ps1 | axefrog_6a035b69e710f8315c24_raw_9012ec39c8d4d0c686b643cfae96beec378aeaac_build.ps1 | $postbuild = ""
foreach ($arg in $args) {
switch ($arg) {
"run" { $postbuild = "run" }
"debug" { $postbuild = "debug" }
}
}
if (!(test-path build)) { mkdir build }
if (!(test-path build/obj)) { mkdir build/obj }
if (!(test-path build/bin)) { mkdir build/bin }
pushd build
$opts = "/Zi","/Gm","/EHsc","/Foobj/","... |
PowerShellCorpus/GithubGist/tbenade_5378295_raw_9169ea70662600e50805f095cba38569e9c297c6_gistfile1.ps1 | tbenade_5378295_raw_9169ea70662600e50805f095cba38569e9c297c6_gistfile1.ps1 | param(
$user,
$app_id,
$revision,
$description,
$api_key
)
#thanks to https://gist.github.com/kfrancis/3164709
#Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default.
$URL = "http://api.newrelic.com/deployments.xml"
$post = "deployment[user]=$user&deplo... |
PowerShellCorpus/GithubGist/zachbonham_3790050_raw_23b851618aa9a39bcb5684878c49b7fa67108274_unmerged.ps1 | zachbonham_3790050_raw_23b851618aa9a39bcb5684878c49b7fa67108274_unmerged.ps1 | <#
Report on unmerged changesets for release planning.
#>
function get_unmerged_changesets($source, $target)
{
write-host "getting unmerged changesets for $source and $target"
$changesets = @()
$data = tf merge /candidate $source $target /recursive
<# $START_INDEX is because tf merge command r... |
PowerShellCorpus/GithubGist/takekazuomi_8130783_raw_df90ac0c4ae5c7d05016f5c92beadbd6375bb883_sample.profile.ps1 | takekazuomi_8130783_raw_df90ac0c4ae5c7d05016f5c92beadbd6375bb883_sample.profile.ps1 | # Load posh-git example profile
. "~\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1"
function Prompt{
"$ "
}
|
PowerShellCorpus/GithubGist/gravejester_5437083f9605b604f1c2_raw_91e3311a67853f67f3de27e90d4d11716847ae89_New-MySqlConnection.ps1 | gravejester_5437083f9605b604f1c2_raw_91e3311a67853f67f3de27e90d4d11716847ae89_New-MySqlConnection.ps1 | function New-MySqlConnection {
<#
.SYNOPSIS
Create a new MySQL database connection.
.DESCRIPTION
This function will create a new MySQL database connection and return a database connection object.
.EXAMPLE
New-MySqlConnection -DatabaseServer 'dbserve... |
PowerShellCorpus/GithubGist/breezhang_7233248_raw_16cf94fc79aa79a6ef99570799894f6911006b5b_checkfiletype.ps1 | breezhang_7233248_raw_16cf94fc79aa79a6ef99570799894f6911006b5b_checkfiletype.ps1 |
function checkfiletype {
$n1 = @{Expression= {$_.ToString().Split("%")[0]};Name ="most_like"};
$n2 = @{Expression= {$_.ToString().Split("%")[1]};Name ="filetype"};
$n3 = @{Expression= {[regex]::Match($_.ToString().Split("%")[1],"(?<=\(\.)\w+").Value};Name ="filetype2"};
if(!(Test-Path $args[0])){
W... |
PowerShellCorpus/GithubGist/miwaniza_10784481_raw_11c89e41ffe8cf1ce535a4deb9b30334d41db899_Get-VaultGroupsAll.ps1 | miwaniza_10784481_raw_11c89e41ffe8cf1ce535a4deb9b30334d41db899_Get-VaultGroupsAll.ps1 | Add-Type -Path "c:\Program Files (x86)\Autodesk\Autodesk Vault 2014 SDK\bin\Autodesk.DataManagement.Client.Framework.Vault.Forms.dll"
$global:g_login=[Autodesk.DataManagement.Client.Framework.Vault.Forms.Library]::Login($null)
# Retreiving all groups
$allGroups = $g_login.WebServiceManager.AdminService.GetAllGroups(... |
PowerShellCorpus/GithubGist/oiotoxt_5586ccbce94ba7018ba4_raw_7792dea4fbbb1b40dbccc2847847d820f654af8f_txt2utf8.ps1 | oiotoxt_5586ccbce94ba7018ba4_raw_7792dea4fbbb1b40dbccc2847847d820f654af8f_txt2utf8.ps1 | #Requires -version 3.0
##############################################################################
# Filename : txt2utf8.ps1
# Version : v1.0
##############################################################################
#
# Convert text files recursively to UTF-8
#
# \ option : input directory
# \ opt... |
PowerShellCorpus/GithubGist/rossnz_8519834_raw_919015b22d05333df0b59d66da653610ad728502_gistfile1.ps1 | rossnz_8519834_raw_919015b22d05333df0b59d66da653610ad728502_gistfile1.ps1 | $myString = "99 Bottles of beer on the wall!"
$myValue = $myString -replace '[ !,.a-zA-Z]'
Write-Host $myValue
|
PowerShellCorpus/GithubGist/Iristyle_3407847_raw_d6dc8c4d366803e8546b7b2d9bd8ac49e95cac1e_BootstrapCanary.ps1 | Iristyle_3407847_raw_d6dc8c4d366803e8546b7b2d9bd8ac49e95cac1e_BootstrapCanary.ps1 | $chromeExtensions = @'
{
"extensions": {
"settings": {
"fdmmgilgnpjigdojojpjoooidkmcomcm": {
"active_permissions": {
"api": [ "cookies" ],
"explicit_host": [ "http://*/*", "https://*/*" ],
"scriptable_host": [ "http://getpostman.com/*", "https:... |
PowerShellCorpus/GithubGist/al3xisb_7703446_raw_e77024fd6c985a8915f5880174c3566cdfdf7408_copyFiles.ps1 | al3xisb_7703446_raw_e77024fd6c985a8915f5880174c3566cdfdf7408_copyFiles.ps1 | # Copy all documents from a library to another
$source = Get-SPWeb "https://server/source"
$destination = Get-SPWeb "https://server/destination"
$files = $source.Lists["Source Library"].RootFolder.Files
$to = $destination.Lists["Destination Library"].RootFolder
foreach($item in $srcFiles) {
if ($item.File) {
... |
PowerShellCorpus/GithubGist/vktr_bfc18478bc73662f88e1_raw_2c0f70920a235591310ae04c13501651081e2dc7_install.ps1 | vktr_bfc18478bc73662f88e1_raw_2c0f70920a235591310ae04c13501651081e2dc7_install.ps1 | <#
Copyright (C) 2014 Viktor Elofsson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distr... |
PowerShellCorpus/GithubGist/rcurlette_7906029_raw_a73ed3e29c1226ac745510da3a65e771c0ad63d9_tridion-gui-extension-installer.ps1 | rcurlette_7906029_raw_a73ed3e29c1226ac745510da3a65e771c0ad63d9_tridion-gui-extension-installer.ps1 | write-output "/***
* _____ _ _ _____ ______ _ _ _____ _ _ _
* / ____| | | |_ _| | ____| | | (_) |_ _| | | | | |
* | | __| | | | | | | |__ __ _| |_ ___ _ __ ___ _ ___ _ __ ... |
PowerShellCorpus/GithubGist/Red-Folder_6643225_raw_2c3c214e839c463bbfef902a9e8043160996be92_HelperScripts.ps1 | Red-Folder_6643225_raw_2c3c214e839c463bbfef902a9e8043160996be92_HelperScripts.ps1 | function filesDifferent($sourceFilename, $targetFilename) {
$targetFileExists = fileExists $targetFilename
if (!($targetFileExists)) {
return $TRUE
}
if ($sourceFilename.Contains(".jar")) {
removeFolder "c:\tmp\jartest\source"
removeFolder "c:\tmp\jartest\target"
$extract... |
PowerShellCorpus/GithubGist/mbourgon_6873071_raw_7d7a8de12022a21eb8c319ff4e926a593c3e8319_sql_script_to_TFS.ps1 | mbourgon_6873071_raw_7d7a8de12022a21eb8c319ff4e926a593c3e8319_sql_script_to_TFS.ps1 | <#
.SYNOPSIS
Will script an object from SQL Server and CHECKIN/ADD to TFS.
.EXAMPLE
sql_script_to_TFS.ps1 -server yourservername -Database yourdatabasname -ScriptType "FULL" -Author yourTFSname -Comment "full checkin of database"
#>
# Purpose - given parameters, script out an object from a SQL Server, usin... |
PowerShellCorpus/GithubGist/pbrumblay_6551936_raw_e6d72504186b2b1761a5cdca22c1ca0a8f75b75f_ftpsupload.ps1 | pbrumblay_6551936_raw_e6d72504186b2b1761a5cdca22c1ca0a8f75b75f_ftpsupload.ps1 | param (
[string]$file = $(throw "-file is required"),
[string]$ftphostpath = $(throw "-ftphostpath is required"),
[string]$username = $(throw "-username is required"),
[string]$password = $(throw "-password is required")
)
$f = dir $file
$req = [System.Net.FtpWebRequest]::Create("ftp://$ftphost... |
PowerShellCorpus/GithubGist/PaulStovell_10638996_raw_9ab5354b328dfef4675556455a89fd5cac012a99_gistfile1.ps1 | PaulStovell_10638996_raw_9ab5354b328dfef4675556455a89fd5cac012a99_gistfile1.ps1 | # Assumes that $appPoolName is set to the name of the application pool you want to modify. For example:
#
# $appPoolName = "DefaultAppPool"
# $appPoolName = $OctopusParameters["YourVariable"]
Import-Module WebAdministration
$appPoolStatus = Get-WebAppPoolState $appPoolName
if ($appPoolStatus.Value -eq "St... |
PowerShellCorpus/GithubGist/altrive_8425136_raw_68266ab3122945ad57acb81dabfb024e8fdd37c2_ToastNotification.ps1 | altrive_8425136_raw_68266ab3122945ad57acb81dabfb024e8fdd37c2_ToastNotification.ps1 | $ErrorActionPreference = "Stop"
#Need to install Nuget packages before execute
Add-Type -Path (Join-Path (Split-Path $profile -Parent) "packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll" -Resolve)
Add-Type -Path (Join-Path (Split-Path $profile -Parent) "\packages\Windows7APICodePack-Shell.... |
PowerShellCorpus/GithubGist/JayBazuzi_c2a6650657acf9f82a0f_raw_ac9d1922a017e96c2ec7b03352854e5bd9c1050e_BoxStarters.ps1 | JayBazuzi_c2a6650657acf9f82a0f_raw_ac9d1922a017e96c2ec7b03352854e5bd9c1050e_BoxStarters.ps1 | # dev
http://boxstarter.org/package/sysinternals,resharper,ncrunch,git,poshgit
# desktop
http://boxstarter.org/package/lastpass,googlechrome,skype,steam,putty,dotnet35
# kids
http://boxstarter.org/package/minecraft,vlc
|
PowerShellCorpus/GithubGist/jrnold_4327373_raw_446d86154e28e6d82709a5c139d5e62b0069dbc5_gistfile1.ps1 | jrnold_4327373_raw_446d86154e28e6d82709a5c139d5e62b0069dbc5_gistfile1.ps1 | For ($i=1; $i -le 4; $i++) {
model --refresh=0 --seed=12345 --chain_id=$i --samples=samples$i.csv
}
|
PowerShellCorpus/GithubGist/ebibibi_7426819_raw_ae9760e88bb72bb802de3c7e9460a1a49c2e9017_Install-SCOMAgents.ps1 | ebibibi_7426819_raw_ae9760e88bb72bb802de3c7e9460a1a49c2e9017_Install-SCOMAgents.ps1 | #This script installs SCOM agents to several clients.
#
#ex)
#.\Install-SCOMAgent.ps1 -ServerName scomserver.domain.name -Targets @("client1.domain.name", "client2.domain.name")
Param(
[parameter(mandatory=$true)]$ServerName,
[parameter(mandatory=$true)]$Targets
)
$InstallAccount = Get-Credential
$... |
PowerShellCorpus/GithubGist/obscuresec_25e8a142eb08bf237799_raw_3748b5b7a50ea148c00ebea6f94f06ed22eaafac_gistfile1.ps1 | obscuresec_25e8a142eb08bf237799_raw_3748b5b7a50ea148c00ebea6f94f06ed22eaafac_gistfile1.ps1 | function Set-MacAttribute {
<#
.SYNOPSIS
Sets the modified, accessed and created (Mac) attributes for a file based on another file or input.
PowerSploit Function: Set-MacAttribute
Author: Chris Campbell (@obscuresec)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependen... |
PowerShellCorpus/GithubGist/urasandesu_51e7d31b9fa3e53489a7_raw_ceafe2b144a6394fa82bf9863f0f42eee29752b4_Get-HelpByMarkdown.ps1 | urasandesu_51e7d31b9fa3e53489a7_raw_ceafe2b144a6394fa82bf9863f0f42eee29752b4_Get-HelpByMarkdown.ps1 | #
# File: Get-HelpByMarkdown.ps1
#
# Author: Akira Sugiura (urasandesu@gmail.com)
#
#
# Copyright (c) 2014 Akira Sugiura
#
# This software is MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... |
PowerShellCorpus/GithubGist/mikeplate_6162420_raw_de9b36dd52763165ca636a1cb2590a3581e2bb3c_ColumnUsage.ps1 | mikeplate_6162420_raw_de9b36dd52763165ca636a1cb2590a3581e2bb3c_ColumnUsage.ps1 | param (
[String]$SiteUrl = 'http://spdev',
[String]$FieldName = 'Title'
)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$site = Get-SPSite $SiteUrl
"Showing where ""$FieldName"" is used"
foreach ($web in $site.AllWebs) {
foreach ($ctype in $web.ContentTypes) {
... |
PowerShellCorpus/GithubGist/tmenier_9199441_raw_85e36e60da07a2cd1c723d798a283340df0eb482_CopyDeployableWebFiles.ps1 | tmenier_9199441_raw_85e36e60da07a2cd1c723d798a283340df0eb482_CopyDeployableWebFiles.ps1 | function copy-deployable-web-files($proj_path, $deploy_dir) {
# copy files where Build Action = "Content"
$proj_dir = split-path -parent $proj_path
[xml]$xml = get-content $proj_path
$xml.Project.ItemGroup | % { $_.Content } | % { $_.Include } | ? { $_ } | % {
$from = "$proj_dir\$_"
$to = split-path -par... |
PowerShellCorpus/GithubGist/josheinstein_cf99bcfdeb573cbbf6a7_raw_6ac161404e9ce9b04d82aa8b32cf62ff99b7f4b0_Write-Highlight.ps1 | josheinstein_cf99bcfdeb573cbbf6a7_raw_6ac161404e9ce9b04d82aa8b32cf62ff99b7f4b0_Write-Highlight.ps1 | #.SYNOPSIS
# Writes text to the host, highlighting portions of the text that
# match one or more regular expression patterns in a different
# color.
#
#.DESCRIPTION
# There are two forms that this command can take: One which specifies
# a single regular expression pattern and a single color (which defaults
# to... |
PowerShellCorpus/GithubGist/JamesTryand_6915577_raw_b1f59833366cb12625105158e3364e25a0716c7a_windowsstatuscodes.ps1 | JamesTryand_6915577_raw_b1f59833366cb12625105158e3364e25a0716c7a_windowsstatuscodes.ps1 | $windowsHttpCodes = [net.httpstatuscode]|gm -s|?{$_.membertype -eq 'Property'}|select name, @{n='code';e={ iex "[int][net.httpstatuscode]::$($_.Name)" } }
|
PowerShellCorpus/GithubGist/ao-zkn_bb8cda1233c2459b187c_raw_f84abd1f1c84c5cba29c2afd37da9dfac37e4e03_Set-LogSetting.ps1 | ao-zkn_bb8cda1233c2459b187c_raw_f84abd1f1c84c5cba29c2afd37da9dfac37e4e03_Set-LogSetting.ps1 | ### 初期値の設定
# ログファイルパス
Remove-Variable -Name LogFilePath -Force -ea silentlycontinue
Set-Variable -Name LogFilePath -Value "common.log" -Option ReadOnly -Scope "Global"
# ログレベル
Remove-Variable -Name LogLevel -Force -ea silentlycontinue
Set-Variable -Name LogLevel -Value 1 -Option ReadOnly -Scope "Global"
# ログの文字エン... |
PowerShellCorpus/GithubGist/naraga_3240847_raw_947448b9012bd9ad47c023251d706315f086dbee_profile.ps1 | naraga_3240847_raw_947448b9012bd9ad47c023251d706315f086dbee_profile.ps1 | function Get-GitRepoPath
{
@( $i=0;`
$pwd.path -split "\\"| `
%{"$(@($pwd.path -split '\\')[0..$i] -join '\')";$i++} | `
? {test-path "$_\\.git"})[0]
}
function Get-GitCurrentBranch
{
((cat "$(Get-GitRepoPath)\.git\HEAD") -split "/")[-1]
}
function prompt
{
"$($pwd.path)[$(Get-GitC... |
PowerShellCorpus/GithubGist/billerby_4214535_raw_78805472449a3fe38bf1a7419bc1ab31f3f11395_strip-content-from-alf-data-dir.ps1 | billerby_4214535_raw_78805472449a3fe38bf1a7419bc1ab31f3f11395_strip-content-from-alf-data-dir.ps1 | # Script that traverses a directory and strips all content from files larger than
# $filesizelimit This comes handy when we need to transfer a backuped directory
# structure to our local environment. We are normally not interested in the content
# of the files when debugging.
# Version 0.1,
# By Erik Billerb... |
PowerShellCorpus/GithubGist/mmooney_4539567_raw_17f05c1f028493c48c2767f1337a27852aeea0ea_deploy.ps1 | mmooney_4539567_raw_17f05c1f028493c48c2767f1337a27852aeea0ea_deploy.ps1 | #Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
#From: #https://gist.github.com/3694398
$subscription = "[SubscriptionName]" #this the name from your .publishsettings file
$service = "[ServiceName]" #this is the name of the cloud service
$storage... |
PowerShellCorpus/GithubGist/peaeater_c7ecd4ef6a0996353ee2_raw_606f9f460ad99d274e2eb0a578c88adbbc0265b0_ocr.ps1 | peaeater_c7ecd4ef6a0996353ee2_raw_606f9f460ad99d274e2eb0a578c88adbbc0265b0_ocr.ps1 | # ocr tif/png to txt
# requires tesseract
Param(
[string]$ext = "tif",
[string]$indir = ".",
[string]$outdir = $indir
)
if (!(test-path $outdir)) {
mkdir $outdir
}
$files = ls "$indir\*.*" -include *.$ext
foreach ($file in $files) {
$o = "$outdir\{0}" -f $file.BaseName
$args... |
PowerShellCorpus/GithubGist/guitarrapc_09e7afdc70356e487470_raw_e93acde05e59b4d11f652438a1b91dd7311d1d69_LocalMD5.ps1 | guitarrapc_09e7afdc70356e487470_raw_e93acde05e59b4d11f652438a1b91dd7311d1d69_LocalMD5.ps1 | Get-FileHash C:\tools\FileName.zip -Algorithm md5
<#
Algorithm Hash Path
--------- ---- ----
MD5... |
PowerShellCorpus/GithubGist/ddhahn_4692388_raw_576d1070145e6a4384d86c4cc7c2c545739bf6a2_ipfilter.ps1 | ddhahn_4692388_raw_576d1070145e6a4384d86c4cc7c2c545739bf6a2_ipfilter.ps1 |
del "c:\temp\vpn_machines.txt"
$machines = gc "c:\temp\hosts" |% {$_.split("`t")[0]}
foreach ($machine in $machines) {
if ($machine.startswith('10.54')) {
Out-File -InputObject $machine "c:\temp\vpn_machines.txt" -Encoding "ASCII" -append
}
}
|
PowerShellCorpus/GithubGist/birryree_2e072b0fd047faebd358_raw_b57c92cd8ce4597840a014aed2e192738e06c72b_gistfile1.ps1 | birryree_2e072b0fd047faebd358_raw_b57c92cd8ce4597840a014aed2e192738e06c72b_gistfile1.ps1 | # Load all computer names from a text file into an array/list
$computers = Get-Content -path C:\users\brynet01\desktop\Computers.txt
# Loop over each computer name in the array/list
foreach ($computer in $computers)
{
# Open a remote registry connection to the current value of $computer. This requires going ... |
PowerShellCorpus/GithubGist/Tatejimaru_59a7786d7ce13fb16c2e_raw_3bd374d3152e3d228f05a13ded6c5a5646424e13_add_alias.ps1 | Tatejimaru_59a7786d7ce13fb16c2e_raw_3bd374d3152e3d228f05a13ded6c5a5646424e13_add_alias.ps1 | # 実行ポリシーの変更
Set-ExecutionPolicy RemoteSigned
# $profileを作成
New-Item $profile -type file -force
# $profileにnotepad++からnppへのエイリアスを追加
"Set-Alias npp C:\Program Files (x86)\Notepad++\notepad++.exe" > $profile
|
PowerShellCorpus/GithubGist/jptomo_8c15ce88f31396ade9a1_raw_3e169c4a1af3dd9312e4ffff0b7735252d473cdf_pwd.ps1 | jptomo_8c15ce88f31396ade9a1_raw_3e169c4a1af3dd9312e4ffff0b7735252d473cdf_pwd.ps1 | $_path = $(Get-Location).Path
if ($_path.IndexOf($ENV:HOME) -eq 0) {
$_path = Join-Path '~' ($PWD.ProviderPath.Remove(0, ($ENV:HOME).Length))
}
|
PowerShellCorpus/GithubGist/pkirch_2f8c1a19c13782a4bcc6_raw_655ca6ea3a56ed9973a4be3a1cd28b86ed7d77de_MVA06-LockedVHDs.ps1 | pkirch_2f8c1a19c13782a4bcc6_raw_655ca6ea3a56ed9973a4be3a1cd28b86ed7d77de_MVA06-LockedVHDs.ps1 | Set-AzureSubscription -SubscriptionName "MSFT MVA Live" -CurrentStorageAccountName pktest1
# sample 1
$blobs = Get-AzureStorageBlob -Container vhds
$blobs | Format-Table -AutoSize
$disks = Get-AzureDisk | Select-Object -ExpandProperty MediaLink | Select-Object -ExpandProperty AbsoluteUri
$disks
$blobs | Sel... |
PowerShellCorpus/GithubGist/adoprog_5480127_raw_c07302e59ed3e2508a9c17d5538f4da8ec46cff7_gistfile1.ps1 | adoprog_5480127_raw_c07302e59ed3e2508a9c17d5538f4da8ec46cff7_gistfile1.ps1 | $checkoutFolder = "%teamcity.build.workingDir%"
$targetDll = "$checkoutFolder\Website\TestProject\bin\Release\TestProject.dll"
$fixture = "TestProject.MediaPlayerEditorTest"
$resultXml = "$checkoutFolder\TestResult.xml"
rm $resultXml -Force -Verbose -ErrorAction SilentlyContinue
$buildOptions = "/xml:$resultXml /fix... |
PowerShellCorpus/GithubGist/appakz_1674457_raw_07bde3c4ed940805cad0e873aa5acecd539d91f6_countLOC.ps1 | appakz_1674457_raw_07bde3c4ed940805cad0e873aa5acecd539d91f6_countLOC.ps1 | #Quick and dirty PS script for counting lines of code in a directory. Output is dumped to a simple CSV file.
#Note that this script doesn't count blank lines.
#Parameters:
# path - the path containing the code files (note that the script will recurse through subfolders
# outputFile - fully qualified path of the file ... |
PowerShellCorpus/GithubGist/mubix_fd0c89ec021f70023695_raw_60d28ae965ddba52995d0deaf83888ea39709bc2_Reset-KrbtgtKeyInteractive.ps1 | mubix_fd0c89ec021f70023695_raw_60d28ae965ddba52995d0deaf83888ea39709bc2_Reset-KrbtgtKeyInteractive.ps1 | <#----------------------------------------------------------------------------------------------------
Release Notes:
v1.4:
Author: Jared Poeppelman, Microsoft
First version published on TechNet Script Gallery
----------------------------------------------------------------------------------... |
PowerShellCorpus/GithubGist/jrampon_2a82f114d88b29110794_raw_a560c2ce9443056459f9a5ea96d3236ddc7be29f_boxstarter.ps1 | jrampon_2a82f114d88b29110794_raw_a560c2ce9443056459f9a5ea96d3236ddc7be29f_boxstarter.ps1 | # From a command prompt:
# START http://boxstarter.org/package/nr/url?<raw-url>
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Bas... |
PowerShellCorpus/GithubGist/sunnyc7_8617483_raw_7f3c5bdaeece1c8ea54173af13f256414dd3a2cb_Sort-WSDL.ps1 | sunnyc7_8617483_raw_7f3c5bdaeece1c8ea54173af13f256414dd3a2cb_Sort-WSDL.ps1 | #requires -version 3.0
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$Path
)
function Sort-NodeArray {
param (
[System.Xml.XmlNode[]]
$SortedNodes
)
foreach ($Node in $SortedNodes) {
$Node.ParentNode.AppendChild($Node.ParentNode.RemoveChild($N... |
PowerShellCorpus/GithubGist/pkskelly_097bb3e6aa3cafe4cb08_raw_4f811f84c6269bb64ec4fd515892f44042c9c975_Add-SPListItemsFromCSV.ps1 | pkskelly_097bb3e6aa3cafe4cb08_raw_4f811f84c6269bb64ec4fd515892f44042c9c975_Add-SPListItemsFromCSV.ps1 | # =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
# Script: Add-SPListItemsFromCSV.ps1
#
# Author: Pete Skelly
# Twitter: ThreeWillLabs
# http://www.threewill.com
#
# Description: Add list items to SharePoint Online -... |
PowerShellCorpus/GithubGist/vermorel_1391893_raw_9b0a38cce91aa8fbafe5adcd0e5f8db048fe075a_measure-loc.ps1 | vermorel_1391893_raw_9b0a38cce91aa8fbafe5adcd0e5f8db048fe075a_measure-loc.ps1 | # Measure-Loc
# By Joannes Vermorel, 2010
# Recurse directories and compute the number of C# lines
# Usage: measure-loc
function Measure-Loc
{
param(
)
begin
{
}
process
{
ls -recurse -filter *.cs | gc | ? { $_.Trim().Length -gt 1 } | measure-object -line
}
end
{
}
}
|
PowerShellCorpus/GithubGist/nizah01_54c18f0dc161c629f44d_raw_635732506909f11cdc81902e25e3ec9c7ba218d6_gistfile1.ps1 | nizah01_54c18f0dc161c629f44d_raw_635732506909f11cdc81902e25e3ec9c7ba218d6_gistfile1.ps1 | $apikey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
$baseurl = "http://localhost/redmine"
# issue ID
$child = 1
$parent = 100
$header = @{"Content-Type"="application/xml"}
$url = $baseurl + "/issues/${child}.xml?key=" + $apikey
$xml = [xml] "<?xml version=`"1.0`" encoding=`"UTF-8`"?><issue><parent_issue_id>... |
PowerShellCorpus/GithubGist/mrdrbob_4125657_raw_6c9ea369d751afbbb0c66f477e4155651fc292e3_Precompile-Site.ps1 | mrdrbob_4125657_raw_6c9ea369d751afbbb0c66f477e4155651fc292e3_Precompile-Site.ps1 | function global:Precompile-Site([string]$csproj, [string]$outputdir = '', [string]$configuration = 'Release') {
if (!($csproj)) {
echo 'You must at least include the path to the .csproj file.'
return;
}
$ErrorActionPreference = 'Stop'
function Exec([scriptblock]$cmd, [string]$errorMessage = "Error e... |
PowerShellCorpus/GithubGist/jm-welch_6022056_raw_8c88d7e31e21fe2a82ab21a5857a82f72be4eba0_Syntax%20Test%20Script.ps1 | jm-welch_6022056_raw_8c88d7e31e21fe2a82ab21a5857a82f72be4eba0_Syntax%20Test%20Script.ps1 | # Syntax test script for PowerGUI
# -------------------------------
# To modify syntax highlighting, use the Script Colors addin
# from http://www.powergui.org/entry.jspa?externalID=3023
# Or edit PowerShellSyntax.xml in your PowerGUI install path
cls
<# Formatted types in example below
$myarray ... |
PowerShellCorpus/GithubGist/atifaziz_5365389_raw_ab2d51b1f807d33ae50f4e3b9c75b9323a133a1a_DataAccess.ps1 | atifaziz_5365389_raw_ab2d51b1f807d33ae50f4e3b9c75b9323a133a1a_DataAccess.ps1 | function Get-DatabaseProvider
{
[CmdletBinding()]
param ($Provider)
if ($provider -eq $null)
{
[Data.OleDb.OleDbFactory]::Instance
}
elseif (!($provider -is [Data.Common.DbProviderFactory]))
{
if (!($provider -is [string]))
{
throw "Provider must be... |
PowerShellCorpus/GithubGist/mrdaemon_1132676_raw_315272a7c73c0dbf0e241ced1d4379d6d42c3b87_import-hvconfigonlyvm.ps1 | mrdaemon_1132676_raw_315272a7c73c0dbf0e241ced1d4379d6d42c3b87_import-hvconfigonlyvm.ps1 | <#
.SYNOPSIS
Safely Imports Hyper-V Virtual Machines that were exported
as configuration only, without State Data (snapshots, VHDs, etc).
.DESCRIPTION
Hyper-V 2008 R2 removed the option to export a Virtual Machine without
its State Data (Snapshots, Virtual Disk Images... |
PowerShellCorpus/GithubGist/ramondeklein_ef6c955b12ee09297cf8_raw_13a96fe693c73f0b0d8ed1ecb19039eefbb581a7_Redirector.ps1 | ramondeklein_ef6c955b12ee09297cf8_raw_13a96fe693c73f0b0d8ed1ecb19039eefbb581a7_Redirector.ps1 | # This Powershell script can be used on a server to redirect HTTP/HTTPS
# traffic to different sources. Make sure your DNS routes the requests
# for the source URLs to this server. It automatically forwards the URL
# to the destination server without altering the rest of the URL.
#
# You can use multiple mappings.... |
PowerShellCorpus/GithubGist/callemall_6123581_raw_f8b6d060bbb021a9b8bc54875d9548536b5f8bbf_PowerShell%20-%20ExtCreateBroadcast.ps1 | callemall_6123581_raw_f8b6d060bbb021a9b8bc54875d9548536b5f8bbf_PowerShell%20-%20ExtCreateBroadcast.ps1 | # ===========================================================================================================================
#
# Send a voice-only broadcast (an announcement) with the name 'Test of Emergency' to the Emergency contacts group outside of the
# calling window. The broadcast should launch immdediat... |
PowerShellCorpus/GithubGist/lantrix_bb0fea3b029dcbd1ca9c_raw_180f1c21e0c1b153dc32f5af762c79cf71c8a85a_stripe_2_ephemeral.ps1 | lantrix_bb0fea3b029dcbd1ca9c_raw_180f1c21e0c1b153dc32f5af762c79cf71c8a85a_stripe_2_ephemeral.ps1 | #
# This will take the two non-system disks on an AWS windows server 2012 R2 instance and ERASE THEM; creating a single striped Volume.
# WARNING: Before using this be sure to check that ((Get-Disk) |where issystem -eq $false) are actually the ***DISKS YOU WANT ERASED***
#
#Get ephemeral disk
$ephemeralDisks = (... |
PowerShellCorpus/GithubGist/gioxx_c71611db976536029c57_raw_e3f522cfc3311eeeb7f27d2ac9a4704edae08c91_LockoutAD.ps1 | gioxx_c71611db976536029c57_raw_e3f522cfc3311eeeb7f27d2ac9a4704edae08c91_LockoutAD.ps1 | # ACTIVE DIRECTORY: Alert mail quando un account utilizza una password errata
#-------------------------------------------------------------------------------
# Autore: GSolone
# Utilizzo: E' necessario schedulare questo script quando si presenta l'evento da monitorare
# (nel caso specifico qui di seguito è ... |
PowerShellCorpus/GithubGist/rucka_4391732_raw_a058b5aced8d263315bd4c015efd22908fcd64c2_build-2012-ppt-download.ps1 | rucka_4391732_raw_a058b5aced8d263315bd4c015efd22908fcd64c2_build-2012-ppt-download.ps1 | [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
foreach ($day in 2..4){
foreach ($number in 000..200 ) {
$url = 'http://video.ch9.ms/sessions/build/2012/' + $day + '-' + ("{0:D3}" -f [int]$number) + '.pptx'
$uri = New-Object System.Uri($url)
$file... |
PowerShellCorpus/GithubGist/VertigoRay_5068130_raw_de960d0eb286250cc7830384a7d066450d907026_SCCM2012-DeleteInvalideDrivers.ps1 | VertigoRay_5068130_raw_de960d0eb286250cc7830384a7d066450d907026_SCCM2012-DeleteInvalideDrivers.ps1 | $a = (Get-WmiObject -ComputerName 'myserver.fqdn' -Namespace 'root\SMS\Site_XXX' -Class 'SMS_Driver' | ?{!(test-path $_.ContentSourcePath)})
$a | %{$_.delete()}
|
PowerShellCorpus/GithubGist/nblumhardt_9884287_raw_0062236de71da5158f0953d24940b4c3b250c981_Octopus.Features.IISWebSite_BeforePostDeploy.ps1 | nblumhardt_9884287_raw_0062236de71da5158f0953d24940b4c3b250c981_Octopus.Features.IISWebSite_BeforePostDeploy.ps1 | ## --------------------------------------------------------------------------------------
## Configuration
## --------------------------------------------------------------------------------------
$ConfirmPreference = "None"
$isEnabled = $OctopusParameters["Octopus.Action.IISWebSite.CreateOrUpdateWebSite"]
if ... |
PowerShellCorpus/GithubGist/coza73_c9f56bfe8b05cd17ac88_raw_3895d14a742570afd704da7bf7d44f11becaf969_vSphere_SysLogCollector_Shortcut.ps1 | coza73_c9f56bfe8b05cd17ac88_raw_3895d14a742570afd704da7bf7d44f11becaf969_vSphere_SysLogCollector_Shortcut.ps1 | ########################################################################################################
#
# Powershell Script for vSphere Syslog Collector
#
# Uses IP address from directories c... |
PowerShellCorpus/GithubGist/robdmoore_af6ec893c85364a97dc4_raw_e6dc89be153afd0b3dc888f7f91dd98ea74266b6_setup-cordova-phonegap.ps1 | robdmoore_af6ec893c85364a97dc4_raw_e6dc89be153afd0b3dc888f7f91dd98ea74266b6_setup-cordova-phonegap.ps1 | # Run this in an elevated PowerShell prompt
<# This script worked on a fresh Windows Server 2012 VM in Azure and the following were the latest versions of each package at the time:
* Chocolatey 0.9.8.27
* java.jdk 7.0.60.1
* apache.ant 1.8.4
* android-sdk 22.6.2
* cordova 3.5.0-0.2.6
* nodejs.install 0.10.29
#>... |
PowerShellCorpus/GithubGist/humbleposh_7366544_raw_a78d1d2d102992e2d03f74492fed4d84530ca0dd_OfflineFiles_1.ps1 | humbleposh_7366544_raw_a78d1d2d102992e2d03f74492fed4d84530ca0dd_OfflineFiles_1.ps1 | # Emumerate Offline Files
$OfflineFilesItem = [wmiclass]"\\localhost\root\cimv2:win32_offlinefilesItem"
$FileList = $OfflineFilesItem.GetInstances()
# Filter based on share that you want to know if someone has taken offline
$FileList | ?{$_.ItemPath -like "\\server\share*"} | select ItemPath
|
PowerShellCorpus/GithubGist/nate-strauser_2346682_raw_75f2e57e88c31e5cbd3aa5b3be5e1fe2275e834e_churnQueue.ps1 | nate-strauser_2346682_raw_75f2e57e88c31e5cbd3aa5b3be5e1fe2275e834e_churnQueue.ps1 | function get-queueLength(){
try {
$s = (New-Object net.webclient).DownloadString('http://localhost:56785/stats.json')
}
catch {
return "queue length unavailable"
}
$queueLength = $s -split (',') | foreach{if ($_ | select-string "queueLength" -quiet){ ($_ -split ":")[1]}}
return $queueLength
... |
PowerShellCorpus/GithubGist/andyhey_5480259_raw_5effbc21d8187a0cb50d98da185966d0777d3b00_gistfile1.ps1 | andyhey_5480259_raw_5effbc21d8187a0cb50d98da185966d0777d3b00_gistfile1.ps1 | Get-ChildItem -Path E:\ROOT_OF_ALL_WEBSITES -Filter umbraco.webservices.dll -Recurse |
PowerShellCorpus/GithubGist/pohatu_10701938_raw_bc56c5325e883986a868671ff28e1ccae1d12ccc_ConvertTo-MarkDownTable.ps1 | pohatu_10701938_raw_bc56c5325e883986a868671ff28e1ccae1d12ccc_ConvertTo-MarkDownTable.ps1 | function ConvertTo-MarkDownTable()
{
$in = [windows.clipboard]::GetText()
$lines = $in.split("`n")
$out=@()
$out += $lines[0] -replace "`r",'' -replace "^","|" -replace ",","|" -replace "$","|`n"
$out += $lines[0] -replace "`r",'' -replace "\w+","---" -replace "^","|" -replace ",","|" ... |
PowerShellCorpus/GithubGist/PyYoshi_3236576_raw_f39dfa10d73044258661cc93a83e590c77b75c70_Microsoft.PowerShell_profile.ps1 | PyYoshi_3236576_raw_f39dfa10d73044258661cc93a83e590c77b75c70_Microsoft.PowerShell_profile.ps1 | # virtualenvwrapper用の設定
$WORKON_HOME = "$HOME\.virtualenvs"
$env:WORKON_HOME = $WORKON_HOME
# $WORKON_HOMEがない場合は作成する
if(-not(Test-Path -Path $WORKON_HOME)){
New-Item -Path $WORKON_HOME -itemType Directory | Out-Null
}
# virtualenvwrapper-powershellを起動時にロードする
$virtualenv_module_path = "$profile\..\Modules\V... |
PowerShellCorpus/GithubGist/XPlantefeve_adf352d758ccf276959d_raw_1001eaf5448b992373e892d6d155e6c13d1b180f_ConvertFrom-Csave.ps1 | XPlantefeve_adf352d758ccf276959d_raw_1001eaf5448b992373e892d6d155e6c13d1b180f_ConvertFrom-Csave.ps1 | Function ConvertFrom-Csave {
[CmdletBinding(DefaultParameterSetName='UseDelimiter')]
Param (
[Parameter(Position=2,ParameterSetName='UseDelimiter')]
[char]$Delimiter = ',',
# FIXME
[string[]] $Header,
[Parameter(Mandatory=$True,Position=1,ValueFromPipeline=$True,V... |
PowerShellCorpus/GithubGist/nzbart_9791503_raw_915cabda04bda9d33a41b4ae9f6f3579a066fd6c_ShowSassTree.ps1 | nzbart_9791503_raw_915cabda04bda9d33a41b4ae9f6f3579a066fd6c_ShowSassTree.ps1 | param([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile, [int][parameter(mandatory)]$Depth, [string][parameter(mandatory)]$IncludePath, [switch]$RenderDotFormat, [switch]$DoNotRecurse)
function RenderImports([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$Ro... |
PowerShellCorpus/GithubGist/jhorsman_88b05a6938ca4de2e021_raw_181433f48fad42e57d67ec25c2ec1803d2f4da10_vs.ps1 | jhorsman_88b05a6938ca4de2e021_raw_181433f48fad42e57d67ec25c2ec1803d2f4da10_vs.ps1 | # http://boxstarter.org/package/url?
# It's nice to be able to browse NuGet files if necessary
cinstm NugetPackageExplorer
# Visual Studio!
cinstm VisualStudio2012Professional
# Get rid of upper case menu in Visual Studio
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStud... |
PowerShellCorpus/GithubGist/willryan_3e6af7565fba09fdadd4_raw_b20354484a34d04f04703afd57bfe64b45dd6c43_stop_iis_express.ps1 | willryan_3e6af7565fba09fdadd4_raw_b20354484a34d04f04703afd57bfe64b45dd6c43_stop_iis_express.ps1 | foreach($proc in (ps | Where { $_.name -like "iisexpress"} )) {
$iisid = $proc.Id
$iis = Get-WmiObject Win32_Process -filter "ProcessId=$iisid" | Where-Object { $_.CommandLine -like "*MyProjectName*" } | Select-Object -first 1
if($iis) {
stop-process -force $iis.ProcessId
}
}
|
PowerShellCorpus/GithubGist/richjenks_5933156_raw_7ebd230726039c211ed0828b78e7a8afe8c21586_delete-empty-directories.ps1 | richjenks_5933156_raw_7ebd230726039c211ed0828b78e7a8afe8c21586_delete-empty-directories.ps1 | Get-ChildItem -recurse | Where {$_.PSIsContainer -and @(Get-ChildItem -Lit $_.Fullname -r | Where {!$_.PSIsContainer}).Length -eq 0} | Remove-Item -recurse
|
PowerShellCorpus/GithubGist/pkirch_aff99159719addbd5e95_raw_08d7cc3dd11e7e0b9b68d4db8b9742431b691ee4_Get-AzureVMSelectStatusSample.ps1 | pkirch_aff99159719addbd5e95_raw_08d7cc3dd11e7e0b9b68d4db8b9742431b691ee4_Get-AzureVMSelectStatusSample.ps1 | Get-AzureVM -ServiceName leasetest3 -Name host3 | Select-Object -Property Status
<# Output
Status
------ ... |
PowerShellCorpus/GithubGist/zorab47_9508715_raw_3601a8227b3bc3faf2f0a3ebc3e5f638cc4640fa_fix-virtualbox-adapters.ps1 | zorab47_9508715_raw_3601a8227b3bc3faf2f0a3ebc3e5f638cc4640fa_fix-virtualbox-adapters.ps1 | # Adaptation of the VMware adapters fix script by Oisin Grehan:
# http://www.nivot.org/post/2008/09/05/VMWareVMNETAdaptersTriggeringPublicProfileForWindowsFirewall.aspx
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx
#
# *NdisDeviceType
#
# The type of the device. The default value is zero, which i... |
PowerShellCorpus/GithubGist/winterheart_5211370_raw_4b6241a7838111f6f19a991c4dfd0a9e95c94b1f_get-all-mailboxes.ps1 | winterheart_5211370_raw_4b6241a7838111f6f19a991c4dfd0a9e95c94b1f_get-all-mailboxes.ps1 | # Copyright (c) 2013 Azamat H. Hackimov <azamat.hackimov@gmail.com>
# MIT License, see http://opensource.org/licenses/MIT for full text
# Этот сценарий получает список всех почтовых аккаунтов Exchange 2010 со следующей информацией:
# Имя, Основной SMTP-адрес, База данных хранения, Количество сообщений, Общий объем... |
PowerShellCorpus/GithubGist/sandrinodimattia_4128649_raw_ba50d35a3b8a787c7adb365bfc440f8949bc5b4c_Import-AzureEndpointsFromCSV.ps1 | sandrinodimattia_4128649_raw_ba50d35a3b8a787c7adb365bfc440f8949bc5b4c_Import-AzureEndpointsFromCSV.ps1 | # Arguments.
param
(
[Microsoft.WindowsAzure.Management.ServiceManagement.Model.PersistentVMRoleContext]$vm = $(throw "'vm' is required."),
[string]$csvFile = $(throw "'csvFile' is required."),
[string]$parameterSet = $(throw "'parameterSet' is required.")
)
Get-ChildItem "${Env:ProgramFiles(x86)}\Microsoft... |
PowerShellCorpus/GithubGist/mbrownnycnyc_9913361_raw_858ae126e2f7bcb417448ec8dfaf826601154b42_veryfastping.ps1 | mbrownnycnyc_9913361_raw_858ae126e2f7bcb417448ec8dfaf826601154b42_veryfastping.ps1 | # with reference to http://theadminguy.com/2009/04/30/portscan-with-powershell/
function fastping{
[CmdletBinding()]
param(
[String]$computername = "127.0.0.1",
[int]$delay = 100
)
$ping = new-object System.Net.NetworkInformation.Ping
# see http://msdn.microsoft.com/en-us/library/system.net.netw... |
PowerShellCorpus/GithubGist/NomikOS_9491294_raw_ec4090feb482e714ae947ef45f73c77bec11d7d0_gistfile1.ps1 | NomikOS_9491294_raw_ec4090feb482e714ae947ef45f73c77bec11d7d0_gistfile1.ps1 | # Encontrar directorios (-type d) en el directorio actual (.) y darles
# acceso 755
find . -type d -exec chmod 755 {} \;
# Encontrar archivos (-type f) en el directorio actual (.) y darles
# acceso 644
find . -type f -exec chmod 644 {} \;
# Encontrar archivos (-type f) html (-name '*.htm*') en el subdirectori... |
PowerShellCorpus/GithubGist/jonnii_5065804_raw_5487f0776d5c3136c421851a9bf6525f03258bef_gistfile1.ps1 | jonnii_5065804_raw_5487f0776d5c3136c421851a9bf6525f03258bef_gistfile1.ps1 | param($installPath, $toolsPath, $package)
# notify the user we're going to be doing something destructive
# find out where to put the files, we're going to assume that the
# solution file is in a ./src directory and we want to put
# everything in a ./build directory at the same level.
$rootDir = (Get-Item $... |
PowerShellCorpus/GithubGist/petarvucetin_5616160_raw_7eda51c29f41522ab575e89436bc325a7c4a48da_NuGet.Downloader.ps1 | petarvucetin_5616160_raw_7eda51c29f41522ab575e89436bc325a7c4a48da_NuGet.Downloader.ps1 | # --- settings ---
$feedUrlBase = "http://go.microsoft.com/fwlink/?LinkID=206669"
# the rest will be params when converting to funclet
$latest = $true
$overwrite = $false
$top = 500 #use $top = $null to grab all
$destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocal"
# --- ... |
PowerShellCorpus/GithubGist/ritalin_c9b9cfe58222c1756735_raw_a0263b0d3d3aa0154aa336a451d6b6db836a3178_autoload-module-config.ps1 | ritalin_c9b9cfe58222c1756735_raw_a0263b0d3d3aa0154aa336a451d6b6db836a3178_autoload-module-config.ps1 | function test(){
get-pscallstack | select -skip 1 -first 1 | %{
if ([io.path]::GetExtension($_.ScriptName) -eq ".psm1") {
if (test-path "$($_.ScriptName).config") {
[xml](Get-Content "$($_.ScriptName).config")
}
elseif (test-path "$($_.ScriptName).json") {
[string]::join('', (Get-Content "$... |
PowerShellCorpus/GithubGist/PProvost_2583571_raw_98fa318e23388717f15b26f0860aea294796af57_gistfile1.ps1 | PProvost_2583571_raw_98fa318e23388717f15b26f0860aea294796af57_gistfile1.ps1 | $str = "some long assed string you want to convert"
$str.ToCharArray() | % { "&#{0};" -f [Convert]::ToInt32($_) } | Join-String | clip
|
PowerShellCorpus/GithubGist/pkirch_553defb9c3b71018aeca_raw_c1193595699c93b717b388e2a9d6981e975f0180_MVA01-AzureVM.ps1 | pkirch_553defb9c3b71018aeca_raw_c1193595699c93b717b388e2a9d6981e975f0180_MVA01-AzureVM.ps1 | # Sample by Peter Kirchner (peter.kirchner@microsoft.com)
# Settings
$subscriptionName = "MSFT MVA Live" # Get-AzureSubscription
$location = "West Europe" # Get-AzureLocation
$serviceName = "pktestservice"
$storageAccountName = "pkteststorage"
$storageContainerName = "vhds"
$adminUsername = "adm_test"
$adminP... |
PowerShellCorpus/GithubGist/colorqualia_8119866_raw_078513100466c52eb0742ab85edf86c1b9880d23_gitignore.ps1 | colorqualia_8119866_raw_078513100466c52eb0742ab85edf86c1b9880d23_gitignore.ps1 | #PowerShell v3 script
Function gitignore {
Param(
[Parameter(Mandatory=$true)]
[string[]]$list
)
$params = $list -join ","
invoke-WebRequest -Uri "http://gitignore.io/api/$params" | select -expandproperty content | out-file -FilePath $(join-path -path $pwd -ChildPath ".gitignore") -Encoding ascii... |
PowerShellCorpus/GithubGist/selfcommit_696d2a45593313044dde_raw_899ca3d60eb03a653158eb0b45dbf9382b3298cd_AdMembers.ps1 | selfcommit_696d2a45593313044dde_raw_899ca3d60eb03a653158eb0b45dbf9382b3298cd_AdMembers.ps1 | $Group = "All"
$path = $("C:\Users\doboyle.STACKEXCHANGE\Desktop\", $Group, ".txt" -join "")
#There's no Header in our TSV, so we define one as "GoogleUser"
$csv = Import-Csv -Delimiter t -Encoding UTF8 -Header GoogleUser -Path $path
foreach ($user in $csv) {
$email = $($user.GoogleUser.ToString(), "@stackover... |
PowerShellCorpus/GithubGist/mortenya_ecd7f4aa55d9abab6a45_raw_77b8ad36567e6e60484b6cd76545e0550acb1b2b_Get-MappedDrives.ps1 | mortenya_ecd7f4aa55d9abab6a45_raw_77b8ad36567e6e60484b6cd76545e0550acb1b2b_Get-MappedDrives.ps1 | function Get-MappedDrives {
<#
.Synopsis
Returns the Mapped Drives on the system
.DESCRIPTION
This function uses WMI to query computers on the network and return the mapped drives, not local drives.
If no user is logged on there will likely be an error about RPC server not available.
.PARAMETER Computer... |
PowerShellCorpus/GithubGist/alienone_a42644cee90c244296d2_raw_90a1b4851394ea17d64059de72102bc7ad25cd57_connector_inventory.ps1 | alienone_a42644cee90c244296d2_raw_90a1b4851394ea17d64059de72102bc7ad25cd57_connector_inventory.ps1 | # Global Variables
$LOGPATH = "\\nicsrv10\network\InfoSec\SIM\SCCM Custom Code for Agents\"
$PROCESSCSV = $LOGPATH + "connector_state.csv"
Function GetComputerStats{
<#
Description: Cull Memory, CPU, and Disk statistics
Input: String object
Output: Hash object
#>
param(
[Parameter(Mandato... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.