full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/GithubGist/mwjcomputing_5067386_raw_33df560b26bde7fd19fb4b678b7e92fa908da2d3_Get-OracleJavaVersion.ps1
mwjcomputing_5067386_raw_33df560b26bde7fd19fb4b678b7e92fa908da2d3_Get-OracleJavaVersion.ps1
function Get-OracleJavaVersion { [CmdletBinding()] param ( [Parameter(ValueFromPipeline=$true)] [alias("Computer")] [string]$ComputerName = "$env:COMPUTERNAME" ) begin{ ## Create WMI filter. $filter = "Name Like 'Java %' AND Vendor='Oracle'" ...
PowerShellCorpus/GithubGist/HarmJ0y_38c1fabcc5c59118c824_raw_2d45d14e9eb23917d267e7c2199ec68bc05105b5_random.ps1
HarmJ0y_38c1fabcc5c59118c824_raw_2d45d14e9eb23917d267e7c2199ec68bc05105b5_random.ps1
$megs=1000;$w=New-Object IO.streamWriter $env:temp\data.dat;[char[]]$c='azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789-_';1..$megs|ForEach-Object{1..4|ForEach-Object{$r=$c|Get-Random -Count $c.Count;$s=-join $r;$w.Write($s*4kb);}};
PowerShellCorpus/GithubGist/altrive_5124149_raw_37f9e72b8404b43c5628694cdd4eda34c03bd187_Copy-WindowsImageSxS.ps1
altrive_5124149_raw_37f9e72b8404b43c5628694cdd4eda34c03bd187_Copy-WindowsImageSxS.ps1
<# .Synopsis Extract WinSxS data from Windows Image and copy to destination folder .Description WinSxS is used to enable Windows features which removed from disk. In offline environment. Enable feature in ServerCore installation need WinSxS data that included in full installer image. WIM extract takes long times ope...
PowerShellCorpus/GithubGist/Stephanvs_a540003a2fdd194b1ac0_raw_73038d08dbda4a78f36447ac701390950f1c160f_Microsoft.PowerShell_profile.ps1
Stephanvs_a540003a2fdd194b1ac0_raw_73038d08dbda4a78f36447ac701390950f1c160f_Microsoft.PowerShell_profile.ps1
Set-Location $env:userprofile\Source # Load posh-git example profile . 'C:\tools\poshgit\dahlbyk-posh-git-c481e5b\profile.example.ps1' function Set-VsCmd { param( [parameter(Mandatory, HelpMessage="Enter VS version as 2010, 2012, or 2013")] [ValidateSet(2010,2012,2013)] [int]$v...
PowerShellCorpus/GithubGist/vgrem_34d0e65b0732a1b368ce_raw_c339f80bcbd6fdad3619674b0b0bd555d144fccd_Invoke-LoadMethodV2.ps1
vgrem_34d0e65b0732a1b368ce_raw_c339f80bcbd6fdad3619674b0b0bd555d144fccd_Invoke-LoadMethodV2.ps1
Function Invoke-LoadMethodV2() { param( $Context = $(throw "Please provide an Client Context"), $Object = $(throw "Please provide an Client Object instance on which to invoke the generic method") ) $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") $type = $Object.GetType() $c...
PowerShellCorpus/GithubGist/onyxhat_650121af37bcb4fefe71_raw_f352888235506896e24f6ba37a2515eb0e310ff3_Update-Windows.ps1
onyxhat_650121af37bcb4fefe71_raw_f352888235506896e24f6ba37a2515eb0e310ff3_Update-Windows.ps1
$Host.UI.RawUI.WindowTitle = "-=Windows Update=-" $Script = $MyInvocation.MyCommand.Definition Write-Host -NoNewline "Checking for Updates..." $UpdateSession = New-Object -Com Microsoft.Update.Session $UpdateSearcher = $UpdateSession.CreateUpdateSearcher() $SearchResult = $UpdateSearcher.Search("IsInstalled=0 an...
PowerShellCorpus/GithubGist/SyntaxC4_8776866_raw_e0434c6089176715ea9b3b9a3f8bd595ecb46078_Microsoft.PowerShell_profile.ps1
SyntaxC4_8776866_raw_e0434c6089176715ea9b3b9a3f8bd595ecb46078_Microsoft.PowerShell_profile.ps1
# It's your choice if you want to enter the code and press the button. # >: 4 8 15 16 23 42 function prompt { write-host '>:' -nonewline return ' ' }
PowerShellCorpus/GithubGist/ao-zkn_de13466be8f1c1e849ea_raw_673c2af1bd6c0606121a97f8287099abe1e83642_Replace-FileName.ps1
ao-zkn_de13466be8f1c1e849ea_raw_673c2af1bd6c0606121a97f8287099abe1e83642_Replace-FileName.ps1
# ------------------------------------------------------------------ # ファイル名を置換する # 関数名:Replace-FileName # 引数 :FilePath ファイル名を置換するファイルパス # :Befor 置換前 # :After 置換後 # 戻り値:なし # ------------------------------------------------------------------ function Replace-FileName([String]$FilePath, [String]$Befor, [Stri...
PowerShellCorpus/GithubGist/konkked_914998828afea8746dff_raw_5d74b79b278147c79b5255079da110359fafea44_touch.ps1
konkked_914998828afea8746dff_raw_5d74b79b278147c79b5255079da110359fafea44_touch.ps1
Function Scaffold ( $path , $type ) { If( !(Test-Path $path) ) { New-Item $path -Type $type -Force } } Function Scaffold-Silent( $path , $type) { Scaffold $path $type > $null } Function Scaffold-File($path) { Scaffold $path File } Function Scaffold-Directory($pat...
PowerShellCorpus/GithubGist/johnmeilleur_e5f49aa3aa8033ae5b11_raw_537f0bb92b3cc8c367ca1ca3e718166c231a4195_CheckInAndPublishAllContent.ps1
johnmeilleur_e5f49aa3aa8033ae5b11_raw_537f0bb92b3cc8c367ca1ca3e718166c231a4195_CheckInAndPublishAllContent.ps1
Param($siteUrl) # This script ensures all of the publishing pages are checked in. $site = Get-SPSite $siteUrl foreach ($web in $site.AllWebs) { $publishingWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web) $publishingPages = $publishingWeb.GetPublishingPages() foreach ($publishi...
PowerShellCorpus/GithubGist/zachbonham_4774553_raw_67f3db1d1004fe498f16608bff5493760f43d438_retry.ps1
zachbonham_4774553_raw_67f3db1d1004fe498f16608bff5493760f43d438_retry.ps1
# complete rip off of http://blog.mirthlab.com/2012/05/25/cleanly-retrying-blocks-of-code-after-an-exception-in-ruby/ # # usage # retriable -tries 5 -action { do-work-that-could-throw-exception } # function retriable($tries=3, $interval=1, [scriptblock]$action) { $retry_count = 1 $the_exception = $n...
PowerShellCorpus/GithubGist/jnsn_7dab1fbe99f1cf719097_raw_fafb72b4e038b2aa80602f66bf25e356d9661c9b_gistfile1.ps1
jnsn_7dab1fbe99f1cf719097_raw_fafb72b4e038b2aa80602f66bf25e356d9661c9b_gistfile1.ps1
$subscription = "[Your Subscription Name]" $service = "[Your Azure Service Name]" $slot = "staging" #staging or production $package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg" $configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg" $timeStampF...
PowerShellCorpus/GithubGist/belotn_6867616_raw_f1826a5fb29fa88112bab6b0c2afe0164c405449_get-RequiredGpoStatus.ps1
belotn_6867616_raw_f1826a5fb29fa88112bab6b0c2afe0164c405449_get-RequiredGpoStatus.ps1
Get-ADOrganizationalUnit -Filter 'OU -like "*Citrix*"' -SearchBase 'dc=fabricam,dc=com' -Properties * |% { $_.gpLink -split ']' } |? { $_ -match '[0,2]$'} |% { (($_ -replace '\[','').split(';')[0]) -replace 'LDAP://',''} |% { get-adobject $_ -properties * } | sort -Unique DisplayName | select DisplayN...
PowerShellCorpus/GithubGist/glallen01_5624949_raw_442deda43d5dd25185bfb58bbedf61acb0052a49_reserve_dhcp.ps1
glallen01_5624949_raw_442deda43d5dd25185bfb58bbedf61acb0052a49_reserve_dhcp.ps1
$DHCPserver="172.16.32.2" $DHCPscope="10.0.0.0" $output="C:\netsh-out.cmd" $csv=Import-CSV "MAC_LIST.csv" # csv file MUST have the following header columns # MAC,IP,NAME # 12345678abcd,10.0.0.20,SITEWKCDR01 $csv | %{ add-content -Encoding ASCII -Path $output -Value "netsh dhcp server $DHCPserve...
PowerShellCorpus/GithubGist/jrotello_3812564_raw_88b4ea3525df45176f1895feb531a300dbab3a63_DownloadTRWallpapers.ps1
jrotello_3812564_raw_88b4ea3525df45176f1895feb531a300dbab3a63_DownloadTRWallpapers.ps1
param( [string[]]$targetDirectories = $(throw "targetDirectories parameter is required"), [string]$size = "1920x1280" ) function getUrl ($imageNumber) { $monthNumber =[System.DateTime]::Today.Month $monthName = [System.Globalization.DateTimeFormatInfo]::InvariantInfo.GetAbbreviatedMonthName($mon...
PowerShellCorpus/GithubGist/gravejester_f44543e603e776f2304a_raw_3b3d548affae65d6f5901784b33678960151262d_Out-CapitalizedString.ps1
gravejester_f44543e603e776f2304a_raw_3b3d548affae65d6f5901784b33678960151262d_Out-CapitalizedString.ps1
function Out-CapitalizedString { param([string]$String) if(-not([System.String]::IsNullOrEmpty($String))) { foreach ($sentence in ($String.Split('.'))) { if(-not([System.String]::IsNullOrEmpty($sentence))) { $sentence = $sentence.Trim() [array]$outputStr...
PowerShellCorpus/GithubGist/guitarrapc_de79bffe9f19104efc8c_raw_7f417647972ceb00377d7a072fe4e4d6ec87ba69_New-ZipCompress.ps1
guitarrapc_de79bffe9f19104efc8c_raw_7f417647972ceb00377d7a072fe4e4d6ec87ba69_New-ZipCompress.ps1
function New-ZipCompress { [CmdletBinding(DefaultParameterSetName="safe")] param( [parameter( mandatory, position = 0, valuefrompipeline, valuefrompipelinebypropertyname)] [string] $source, [parameter( ma...
PowerShellCorpus/GithubGist/harrybiscuit_1877081_raw_dc408d1ad455804023e3c38d5284be725b318ea0_CreateJunction.ps1
harrybiscuit_1877081_raw_dc408d1ad455804023e3c38d5284be725b318ea0_CreateJunction.ps1
$junctionPath = ".\junction.exe" $toBeCreated = "c:\MyNewJunction"; if(!(Test-Path $junctionPath)){ Write-Host "Expected Junction.exe to be in the same folder as this script file. This file is required to create the new junction." Write-Host "Press any key to continue ..." $x = $host.UI.RawUI.Rea...
PowerShellCorpus/GithubGist/guitarrapc_c2136dc0cb6a15f721bc_raw_b0ad519a442801269acaa803be538d7764316add_TypeSuccessfullyPassed.ps1
guitarrapc_c2136dc0cb6a15f721bc_raw_b0ad519a442801269acaa803be538d7764316add_TypeSuccessfullyPassed.ps1
fuga | %{$_} # Now you'll see Intellisence work when you type $_.
PowerShellCorpus/GithubGist/zippy1981_1576084_raw_e290558724287f936b6ee726781b0f6a1613688f_mstsc-Ac.ps1
zippy1981_1576084_raw_e290558724287f936b6ee726781b0f6a1613688f_mstsc-Ac.ps1
<# .SYNOPSIS mstsc-Ac.ps1 (Version 1.0, 7 Jan 2012) The author may be contacted via zippy1981@gmail.com The latest authoritative version of this script is always available at http://bit.ly/mstsc-Ac .DESCRIPTION This script will see if a host is up and listening on a given port, and start a remote desktop conn...
PowerShellCorpus/GithubGist/jen20_11290410_raw_c3e177f0f8d48bfa3168785f068279ee9a6162b1_pin-vs.ps1
jen20_11290410_raw_c3e177f0f8d48bfa3168785f068279ee9a6162b1_pin-vs.ps1
$shell = new-object -com "Shell.Application" $dir = $shell.Namespace("C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE") $item = $dir.ParseName("devenv.exe") $item.InvokeVerb('taskbarpin')
PowerShellCorpus/GithubGist/binamov_6499320_raw_9692799b4ac53aac29d819ca77036bc5f25ea237_user_data.ps1
binamov_6499320_raw_9692799b4ac53aac29d819ca77036bc5f25ea237_user_data.ps1
<powershell> ##### #DON'T FORGET TO SET/CHANGE THE USERNAME/PASSWORD BELOW! ##### $user="chef" $password="chef" # Disable password complexity requirements $seccfg = [IO.Path]::GetTempFileName() secedit /export /cfg $seccfg (Get-Content $seccfg) | Foreach-Object {$_ -replace "PasswordComplexity\s*=\s*1"...
PowerShellCorpus/GithubGist/wpsmith_4190b9a03bc1544a7df5_raw_da4700a0b3fb2cf5decfabba42e7e439f860e26e_self-elevating-script.ps1
wpsmith_4190b9a03bc1544a7df5_raw_da4700a0b3fb2cf5decfabba42e7e439f860e26e_self-elevating-script.ps1
# Get the ID and security principal of the current user account $myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() $myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) # Get the security principal for the Administrator role $adminRole=[System.Security.Princi...
PowerShellCorpus/GithubGist/meganehouser_8619643_raw_bf0584e71ef4ac1e1ca3d9f693a828d794492b14_CopyZip.ps1
meganehouser_8619643_raw_bf0584e71ef4ac1e1ca3d9f693a828d794492b14_CopyZip.ps1
### 使い方 ### 1. PowerShellを起動する ### 2. PowerShell 実行権限の変更(最初の一回のみ実行) ### Set-ExecutionPolicy RemoteSigned ### 3. 7z をインストール(インストールしたフォルダ内に7z.exeがある) ### http://sevenzip.sourceforge.jp/download.html ### 4. このスクリプトをCopyZip.ps1というファイル名で実行 ### 5. コピー元のフォルダパス、コピー先・ZIPファイル作成先のフォルダパス、7z.exeのパスを書き換える ### 6. PowerS...
PowerShellCorpus/GithubGist/n-fukuju_8487265_raw_ee0206d054b67e93c8271d51e4a8ff7e420c4ffa_assignletter.ps1
n-fukuju_8487265_raw_ee0206d054b67e93c8271d51e4a8ff7e420c4ffa_assignletter.ps1
$beforeLetter = "D" $afterLetter = "E" # ドライブのボリューム番号を取得。 Write-Output "list volume" | DiskPart | ?{$_ -match ("Volume[ ]{1}(?<volume>\d)[ ]*"+ $beforeLetter)} | Out-Null $volume = $Matches["volume"] # ボリュームにドライブ文字を割り当てる。 Write-Output ("select volume {0}`nassign letter={1}" -f $volume, $afterLetter) | DiskPar...
PowerShellCorpus/GithubGist/joshyu_fa8551e343bc860f9a87_raw_d86a0d64139ac6d3be475af7359480880242b9e5_importsp.ps1
joshyu_fa8551e343bc860f9a87_raw_d86a0d64139ac6d3be475af7359480880242b9e5_importsp.ps1
$url = "http://apcndae-dzn493x/testsub" $pathb = "D:/spCmdlets" $listtoback = "$pathb/list.txt" $path = "$pathb/backup" $specifytitle = $args[0] if(![string]::IsNullOrEmpty($specifytitle)){ Write-Output "import $specifytitle" $ff = $path+"/"+ $specifytitle + ".cmp" Import-SPWeb $url -Path $ff }els...
PowerShellCorpus/GithubGist/andreaswasita_ae980580fd42fa70c957_raw_08069d8e3dac1807d36d56b9aae41c2158417ccf_ClusterNetworkCloudServiceVIP.ps1
andreaswasita_ae980580fd42fa70c957_raw_08069d8e3dac1807d36d56b9aae41c2158417ccf_ClusterNetworkCloudServiceVIP.ps1
# Define variables $ClusterNetworkName = "Cluster Network 1" # the cluster network name $IPResourceName = "IP Address 10.0.1.0" # the IP Address resource name $CloudServiceIP = "23.100.xxx.xxx" # IP address of your cloud service Import-Module FailoverClusters Get-ClusterResource $IPResourceName | Set-ClusterParameter ...
PowerShellCorpus/GithubGist/sandrinodimattia_4114961_raw_9d0a52bf4ee7e36fa9cefad144a03b6041db26f9_gistfile1.ps1
sandrinodimattia_4114961_raw_9d0a52bf4ee7e36fa9cefad144a03b6041db26f9_gistfile1.ps1
# Arguments. param ( [Microsoft.WindowsAzure.Management.ServiceManagement.Model.PersistentVMRoleContext]$vm = $(throw "'vm' is required."), [int]$publicPort = $(throw "'publicPort' is required."), [int]$dynamicPortFirst = $(throw "'dynamicPortFirst' is required."), [int]$dynamicPortLast = $(throw "'dynamicPo...
PowerShellCorpus/GithubGist/DanSmith_3668859_raw_d3979c2b4c598dc23f4ffb31fa04bafa55d57bab_RegisterEventLog.ps1
DanSmith_3668859_raw_d3979c2b4c598dc23f4ffb31fa04bafa55d57bab_RegisterEventLog.ps1
# https://github.com/dansmith # $source = "My Application Name" $wid=[System.Security.Principal.WindowsIdentity]::GetCurrent() $prp=new-object System.Security.Principal.WindowsPrincipal($wid) $adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator $IsAdmin=$prp.IsInRole($adm) if($IsAdmin -eq $fa...
PowerShellCorpus/GithubGist/schakko_4713248_raw_eb2072fe7699413fbe058bdbef5f1a585896c7d1_check_microsoft_windows_software_raid.ps1
schakko_4713248_raw_eb2072fe7699413fbe058bdbef5f1a585896c7d1_check_microsoft_windows_software_raid.ps1
# A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. # The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason) # or using the new PowerShell API introduced with ...
PowerShellCorpus/GithubGist/djcsdy_931645_raw_41ff54f8d05306604c3a003e56fd568809c524f4_svn-clean-all.ps1
djcsdy_931645_raw_41ff54f8d05306604c3a003e56fd568809c524f4_svn-clean-all.ps1
svn status --no-ignore | Select-String '^[?I]' | ForEach-Object { [Regex]::Match($_.Line, '^[^\s]*\s+(.*)$').Groups[1].Value } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
PowerShellCorpus/GithubGist/kmoormann_3361439_raw_a36bc173ced73a39271e414d583d984f242e85f1_ClearDir.ps1
kmoormann_3361439_raw_a36bc173ced73a39271e414d583d984f242e85f1_ClearDir.ps1
function Global:ClearDir([string] $PATH) { $AllItemsInPath = $Path + "*" Remove-Item $AllItemsInPath -recurse -force }
PowerShellCorpus/GithubGist/robdmoore_dcd325e0ee73493ff1b7_raw_ef8b67f67de19afd60c0b3e0b970b7b2319eefb0_gistfile1.ps1
robdmoore_dcd325e0ee73493ff1b7_raw_ef8b67f67de19afd60c0b3e0b970b7b2319eefb0_gistfile1.ps1
$scriptpath = $(Split-Path $MyInvocation.MyCommand.Path) cd $scriptpath if (-not (ls *.publishsettings | Test-Any)) { Write-Warning "Please save a .publishsettings file to this folder" start . Get-AzurePublishSettingsFile exit 1 } Import-AzurePublishSettingsFile
PowerShellCorpus/GithubGist/jayotterbein_438ae58b5ab9f64399ea_raw_c35a8ff076d34979dbd312750f62298ccb61e7c8_sln.ps1
jayotterbein_438ae58b5ab9f64399ea_raw_c35a8ff076d34979dbd312750f62298ccb61e7c8_sln.ps1
Function sln { [string[]]$installed = @(gci HKLM:\Software\Microsoft\VisualStudio\) |% { $_.Name } |% { Split-Path $_ -Leaf } $versions = @() foreach ($i in $installed) { [Version]$v = "0.0" if ([Version]::TryParse($i, [ref]$v)) { $versions += $v } ...
PowerShellCorpus/GithubGist/Astn_6e1f27aae1fff631f441_raw_a121f23b429dc55c76c820325c6507caa256fcef_all-git-remove-config-for-nustache.ps1
Astn_6e1f27aae1fff631f441_raw_a121f23b429dc55c76c820325c6507caa256fcef_all-git-remove-config-for-nustache.ps1
## remove all *.Config where there is a *.nustache.config in the same directory ## for any given n ## f(n) = if exists n.nustache.config and exists n.config ## then remove n.config # for each Git Repo below the current directory ls -Directory | Where-Object { (ls $_ -Directory -Hidden -Filter ".git")} | Fo...
PowerShellCorpus/GithubGist/zhujo01_fa324e86946dfca3b119_raw_0c59b17029bf72456795d500eb6ac64ba2fb44e1_vmware-openstack.ps1
zhujo01_fa324e86946dfca3b119_raw_0c59b17029bf72456795d500eb6ac64ba2fb44e1_vmware-openstack.ps1
######################################################################## # VMware Windows Bootstrapping Script # Supported OS: # - Windows 2008 Server R2 SP1 (TESTED) # - Windows 2008 Server (TO BE TESTED) # - Windows 2012 Server (TO BE TESTED) # Image Transformation Target Cloud # - Openstack #...
PowerShellCorpus/GithubGist/ranniery_1063498091a21b82e68c_raw_9d817a3d8486a7415a9768f08730dc8b7b2590f6_RepairWMI.ps1
ranniery_1063498091a21b82e68c_raw_9d817a3d8486a7415a9768f08730dc8b7b2590f6_RepairWMI.ps1
########################### # Ranniery Holanda # # email@ranniery.com.br # # @_ranniery # # 23/07/2014 # ########################### # RepairWMI.ps1 # ########################### # Parando e desativando o serviço do WMI # (Get-service Winmgmt).stop() Se...
PowerShellCorpus/GithubGist/seanbamforth_9436765_raw_9d3936fa46624df23c20c8695ee8d80a904867a9_copylocaltos3.ps1
seanbamforth_9436765_raw_9d3936fa46624df23c20c8695ee8d80a904867a9_copylocaltos3.ps1
param ( [string]$from = $(get-location).ToString(), [string]$to = "selectcs-backup", [switch]$mirror ) #$DebugPreference = "Continue" #todo:if no parameters, then show instructions #todo:mirror option into own function #todo:aws details need to be in the environment. #todo:Copy from & copy ...
PowerShellCorpus/GithubGist/jonschoning_5447758_raw_d86adc409913eb04e0bef5fbcd14ebc2b73d510e_set-iis-physicalpaths.ps1
jonschoning_5447758_raw_d86adc409913eb04e0bef5fbcd14ebc2b73d510e_set-iis-physicalpaths.ps1
import-module WebAdministration $root = "IIS:\Sites\DefaultWebSite" Function Set-IIS-PhysicalPaths { Param( [parameter(mandatory=$true)][string]$branch ) Set-ItemProperty "$($root)\SubApplication" -Name physicalPath -Value "C:\inetpub\wwwroot\$($branch)\" -Verbose } if($args.length -...
PowerShellCorpus/GithubGist/ziembor_9433720_raw_f042d430051a4767c5a347934616b3c54fabf923_Out-SpeechFx.ps1
ziembor_9433720_raw_f042d430051a4767c5a347934616b3c54fabf923_Out-SpeechFx.ps1
function Out-SpeechFx {[CmdletBinding()] param([Parameter(Position=0, Mandatory=$false,ValueFromPipeline=$true)][alias("text")][string] $Message = 'Brak tekstu do czytania', [Parameter(Position=1)][string][validateset('Male','Female')] $Gender = 'Female', [Parameter(Position=2)][string] $lang = (Get-UICulture)....
PowerShellCorpus/GithubGist/altrive_9151365_raw_eecfc423e15a9487805b55fa5d5e7b3873294b1b_SetAccountPrevilage.ps1
altrive_9151365_raw_eecfc423e15a9487805b55fa5d5e7b3873294b1b_SetAccountPrevilage.ps1
#Requires -RunAsAdministrator function Main { $ErrorActionPreference = "Stop" $VerbosePreference = "Continue" #Target account to assign previlage $svcAccount = "TestSvc" #サービスとしてログオン Write-Verbose ("Set account previlage({0}) to '{1}'" -f "SeServiceLogonRight", $svcAccount) [LsaWrapper]::...
PowerShellCorpus/GithubGist/marcind_9512656_raw_4aaaf190a53262526b3574ba53587bfbf990e4da_gistfile1.ps1
marcind_9512656_raw_4aaaf190a53262526b3574ba53587bfbf990e4da_gistfile1.ps1
# Execute this in Nuget powershell console get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug"} | %{ $_.Value = $False } } #
PowerShellCorpus/GithubGist/ianbattersby_4546636_raw_8bef5088c2c412da77200411bcb73fa41a7f875c_gistfile1.ps1
ianbattersby_4546636_raw_8bef5088c2c412da77200411bcb73fa41a7f875c_gistfile1.ps1
$vmm = Get-SCVMMServer -ComputerName "my-vmm-host" $ls = Get-SCLibraryServer -ComputerName "my-vmm-host" Import-SCVirtualMachine -ImportVMPath "c:\temp\myovf.ovf" -LibraryServerObject $ls -VMMServerObject $vmm -LibrarySharePath "\\my-vmm-host\MSSCVMMLibrary\Import\" -VHDSourcePath "C:\Virtual Machines\BlankVHD.vhd"...
PowerShellCorpus/GithubGist/altrive_8023060_raw_d5e01e9473599f3c678162dca89ad0dcb10fdc88_Add-TypeDefinition.ps1
altrive_8023060_raw_d5e01e9473599f3c678162dca89ad0dcb10fdc88_Add-TypeDefinition.ps1
function Add-TypeDefinition { [CmdletBinding()] param ( [string] $Path, [string[]] $ReferencedAssemblies = @("Microsoft.CSharp"), [string] $OutputAssembly, [switch] $IgnoreWarnings, [switch] $UseTypeAlias ) $ErrorActionPreference = "Stop" if (!(Test-Path $Pat...
PowerShellCorpus/GithubGist/guillaume8375_5991511_raw_95b3bfa2a866617bbdd014f33b6637d4a1bb014f_top_powershell.ps1
guillaume8375_5991511_raw_95b3bfa2a866617bbdd014f33b6637d4a1bb014f_top_powershell.ps1
while (1) {ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls; write-host "Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName"; write-host "------- ------ ----- ----- ----- ------ -- -----------"}
PowerShellCorpus/GithubGist/ctrlbold_c22e2a213f5b05e47c0c_raw_3ae37441d728c172f1f4b8d70779d67932e40f2d_Get-Duplicates.ps1
ctrlbold_c22e2a213f5b05e47c0c_raw_3ae37441d728c172f1f4b8d70779d67932e40f2d_Get-Duplicates.ps1
# Create Datatable $dt = New-Object System.Data.Datatable "Music" [void]$dt.Columns.Add("Artist") [void]$dt.Columns.Add("Genre") [void]$dt.Columns.Add("Album") [void]$dt.Columns.Add("ReleaseYear") # Add data [void]$dt.Rows.Add("Poison","Glam Metal","Open Up and Say... Ahh!",1988) [void]$dt.Rows.Add("Cinderell...
PowerShellCorpus/GithubGist/vbratkev_03bd128c2f494711a4e4_raw_393b32662bdb832aec63e60fd974c8e79aeda613_ZipUtils.ps1
vbratkev_03bd128c2f494711a4e4_raw_393b32662bdb832aec63e60fd974c8e79aeda613_ZipUtils.ps1
function zip ($zipFilePath, $targetDir) { # load Ionic.Zip.dll [System.Reflection.Assembly]::LoadFrom(path\to\Ionic.Zip.dll) $encoding = [System.Text.Encoding]::GetEncoding("shift_jis") # 日本語のファイルを扱うために必要 $zipfile = new-object Ionic.Zip.ZipFile($encoding) $zipfile.AddDirectory($targetDir) if (!(...
PowerShellCorpus/GithubGist/staxmanade_4206883_raw_5e8f27a83fc308165a28425cfce1ac8b11d3c147_Powershell_Create_Change_Package.ps1
staxmanade_4206883_raw_5e8f27a83fc308165a28425cfce1ac8b11d3c147_Powershell_Create_Change_Package.ps1
param( $beginSha = $(throw '-beginSha is required'), $endSha = $(throw '-endSha is required'), $projectName = $( (get-item .).name ) ) # Get a list of all the files that have been added/modified/deleted $filesWithMods = git diff --name-status $beginSha $endSha | Select @{Name="ChangeType";Expression={$_.Su...
PowerShellCorpus/GithubGist/mwjcomputing_4691239_raw_6be19594c1c3446a46bd543ebbd293e9147057ec_IgnoreCertErrors.ps1
mwjcomputing_4691239_raw_6be19594c1c3446a46bd543ebbd293e9147057ec_IgnoreCertErrors.ps1
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
PowerShellCorpus/GithubGist/ploegert_fa02e9c1a943f97219b9_raw_17f05c1f028493c48c2767f1337a27852aeea0ea_Deploy-WebSite.ps1
ploegert_fa02e9c1a943f97219b9_raw_17f05c1f028493c48c2767f1337a27852aeea0ea_Deploy-WebSite.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/JingwenTian_8858531_raw_af3fd13e154e35a8740210369151ff80663a5377_gistfile1.ps1
JingwenTian_8858531_raw_af3fd13e154e35a8740210369151ff80663a5377_gistfile1.ps1
vi /etc/ssh/sshd_config #把 PermitRootLogin yes 改为 PermitRootLogin no #重启sshd服务 service sshd restart
PowerShellCorpus/GithubGist/jonretting_34ed19ed2b06d99c484b_raw_1eb36bcb32e532c805609080a5a006778baebf4d_gistfile1.ps1
jonretting_34ed19ed2b06d99c484b_raw_1eb36bcb32e532c805609080a5a006778baebf4d_gistfile1.ps1
# Your NAS Synology device suddenly lost connection to your Windows Domain Controller, and or intermittent AD connectivity issues. # Symptoms include but not limited to: # - Failing to rejoin after removing the account on the Domain. # - Failing to rejoin without any changes # - Join attempt results in = "Failed ...
PowerShellCorpus/GithubGist/malexw_7848290_raw_711abc8b2bcc53bd718d546f694345b0bd60ef12_gowork.ps1
malexw_7848290_raw_711abc8b2bcc53bd718d546f694345b0bd60ef12_gowork.ps1
$Env:gopath = $args[0] cd $args[0]
PowerShellCorpus/GithubGist/wojtha_1039912_raw_5d458ef59689419aaca85924932760dca2a5e74c_drush_module_cleanup.ps1
wojtha_1039912_raw_5d458ef59689419aaca85924932760dca2a5e74c_drush_module_cleanup.ps1
############################################################################### # # Cleanup of Drupal modules using Drush & Windows PowerShell # # Author: Vojtech Kusy <wojtha@gmail.com> # ############################################################################### # Create directory .trash if doesn't exist...
PowerShellCorpus/GithubGist/rm-jamotion_9066943_raw_8eda181e879de240fbf36e65a0be8417c4155f6b_JoomlaExtensionLinkerForWindows.ps1
rm-jamotion_9066943_raw_8eda181e879de240fbf36e65a0be8417c4155f6b_JoomlaExtensionLinkerForWindows.ps1
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $princ = New-Object System.Security.Principal.WindowsPrincipal($identity) if(!$princ.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) { $powershell = [System.Diagnostics.Process]::GetCurrentProcess() $psi = New-Ob...
PowerShellCorpus/GithubGist/guitarrapc_e78bbd4ddc07389e17d6_raw_2e058ed77e51327a14195d8aaa91268ddafa145b_Copy-StrictedFilterFileWithDirectoryStructure.ps1
guitarrapc_e78bbd4ddc07389e17d6_raw_2e058ed77e51327a14195d8aaa91268ddafa145b_Copy-StrictedFilterFileWithDirectoryStructure.ps1
<# # Copy "All Directory Structure" and "File" which Extension type is .bat Copy d:\GitHub\valentia -Destination d:\fuga -Force -Recurse -Filter "*.bat" # Copy "All Directory Structure" and "File" which Extension type is .md Copy d:\GitHub\valentia -Destination d:\fuga -Force -Recurse -Filter "*.md" # If you w...
PowerShellCorpus/GithubGist/JingwenTian_8875701_raw_73ede657e39566fd054fac099aa47f60dfb758f3_gistfile1.ps1
JingwenTian_8875701_raw_73ede657e39566fd054fac099aa47f60dfb758f3_gistfile1.ps1
#删除sth目录下文件 git rm sth/* -r #然后commit git commit -a -m 'remove sth' #再次push就可以了 git push -u origin master #可以增加忽略文件: vim .gitignore #在文件中添加 sth/**/*
PowerShellCorpus/GithubGist/miriyagi_8475177_raw_38624af708fc2c7b462e69717f26c1675abe2b87_Microsoft.PowerShell_profile.ps1
miriyagi_8475177_raw_38624af708fc2c7b462e69717f26c1675abe2b87_Microsoft.PowerShell_profile.ps1
Import-Module PSReadLine Set-PSReadlineOption -EditMode Emacs Set-PSReadlineKeyHandler -Key UpArrow -Function PreviousHistory Set-PSReadlineKeyHandler -Key DownArrow -Function NextHistory Set-PSReadlineKeyHandler -Key Ctrl+I -Function Complete Set-PSReadlineKeyHandler -Key Ctrl+K -Function KillLine Set-PSReadline...
PowerShellCorpus/GithubGist/sebnilsson_6522182_raw_ba4adb7032ddd56bf45c53d44fbfeea199df8bed_chocolatey-unzip-movetoparent.ps1
sebnilsson_6522182_raw_ba4adb7032ddd56bf45c53d44fbfeea199df8bed_chocolatey-unzip-movetoparent.ps1
$packageName = '{PACKAGE_NAME}' $url = 'http://SITE.COM/FILE.ZIP' $subFolderFilter = '*SUBFOLDER*' try { $rootDir = Join-Path "$env:systemdrive\" $packageName if (Test-Path "$rootDir") { Write-Host "Removing existing files, keeping config-files" Remove-Item "$rootDir\*" -Recurse...
PowerShellCorpus/GithubGist/canoas_8976244_raw_445127140653fd6a2284b6bd48cf4239155d7ee3_Clear-TMGCachedUrl.ps1
canoas_8976244_raw_445127140653fd6a2284b6bd48cf4239155d7ee3_Clear-TMGCachedUrl.ps1
param( $url = (Read-Host "Url? e.g http://www.maxfinance.pt/img/frame5.jpg") ) begin { $tmgroot = new-object -comobject FPC.Root $tmgarray = $tmgroot.GetContainingArray() $myCache = $tmgArray.Cache.CacheContents $regex = ‘([a-zA-Z]{3,})://([\w-\.]+)(/[\w- ./?%&=]*)*?’ } process { if($url -match $rege...
PowerShellCorpus/GithubGist/joshtransient_5984713_raw_0692c891ab3d7da9e313c77a4cba9e66bd45544a_Recover-SecureStoreCredentials.ps1
joshtransient_5984713_raw_0692c891ab3d7da9e313c77a4cba9e66bd45544a_Recover-SecureStoreCredentials.ps1
<# .SYNOPSIS Secure Store Credential Extraction .NOTES Author: Josh Leach, Critigen Date: 27 Mar 2013 Adapted from http://msdn.microsoft.com/en-us/library/ff394459(v=office.14).aspx .DESCRIPTION Pulls information about Secure Store target applications. The account running this script must ...
PowerShellCorpus/GithubGist/ferventcoder_9788258_raw_0991fc0ea1d535fc5b9ce99e432fd9a848103682_UserAdd.ps1
ferventcoder_9788258_raw_0991fc0ea1d535fc5b9ce99e432fd9a848103682_UserAdd.ps1
param ( [parameter(Position=0)] [alias("user")][string]$userName, [alias("group")][string]$groupName=$null, [alias("home")][string]$homeDirectory=$null ) # there are some much simpler ways to do this with the Active-Directory Module # like Get-ADUser, Set-ADUser, etc but it is not installed on Win2008 (n...
PowerShellCorpus/GithubGist/jasonf_8d0343f0fe8f0456b05c_raw_43028a1948f71780e3193118937ef3f753a614a2_get-advanced-setting-cluster.ps1
jasonf_8d0343f0fe8f0456b05c_raw_43028a1948f71780e3193118937ef3f753a614a2_get-advanced-setting-cluster.ps1
# Change the following variables $vcenter = "myvcenter.domain.local" # Advanced setting value to find $advanced_setting = "Misc.SIOControlFlag2" #cluster to check $cluster_name = "cluster_name" # No changes past this point Connect-VIServer $vcenter -Credential (Get-Credential) Get-AdvancedSetting -Entity (Get...
PowerShellCorpus/GithubGist/jeffpatton1971_d8460a45117192817ef3_raw_29f4c2eb8af2942ada87278a3596ed2febc75d81_Set-ZenossPermissions.ps1
jeffpatton1971_d8460a45117192817ef3_raw_29f4c2eb8af2942ada87278a3596ed2febc75d81_Set-ZenossPermissions.ps1
<# .SYNOPSIS Setup permissions for Zenoss monitoring on Windows .DESCRIPTION This script works under the assumption that you have a GPO or manually added your zenoss user to several groups. In testing these are the groups that appear to work Backup Operators Distributed COM Users ...
PowerShellCorpus/GithubGist/andreaswasita_974272eba92eb505c220_raw_09a674861560642fd2ad25751aec4c50418f9148_Get-AzureVMExtensionAntiMalware.ps1
andreaswasita_974272eba92eb505c220_raw_09a674861560642fd2ad25751aec4c50418f9148_Get-AzureVMExtensionAntiMalware.ps1
$servicename = "AzureVMAntiMalware" $name = "MyAzureVM01" # Get Azure VM $vm = Get-AzureVM –ServiceName $servicename –Name $name # Get Microsoft Antimalware Agent Azure Virtual Machine Status Get-AzureVMExtension -Publisher Microsoft.Azure.Security -ExtensionName IaaSAntimalware -Version 1.* -VM $vm.VM
PowerShellCorpus/GithubGist/mhinze_1571601_raw_dd45f9370ea204cf56add69a0ca8ec6fadddbd7a_ac.ps1
mhinze_1571601_raw_dd45f9370ea204cf56add69a0ca8ec6fadddbd7a_ac.ps1
function global:aspcomp() { $dir = Join-Path $solutionScriptsContainer "..\Your.Web.Project" -Resolve $bin = Join-Path $dir "bin" $compiler = Join-Path $([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()) "aspnet_compiler.exe" & $compiler -p $dir -v $bin }
PowerShellCorpus/GithubGist/WilbertOnGithub_2137097_raw_4a275fa81e678dfaee37c3550b31db61cfa72e71_postgitsvn.ps1
WilbertOnGithub_2137097_raw_4a275fa81e678dfaee37c3550b31db61cfa72e71_postgitsvn.ps1
# Script that cleans up an entire directory with Git repositories # that have been imported from Subversion using the 'git svn clone' # command. # It does the following: # - Recurses through all subdirectory in the directory you specify. # For each git repository in a subdirectory: # - Parses all tags from the...
PowerShellCorpus/GithubGist/matthewhatch_a5d31fed0b03ed8bef61_raw_ae8ab44e17af5e404ecbf7ee3b4c795b146c900c_gistfile1.ps1
matthewhatch_a5d31fed0b03ed8bef61_raw_ae8ab44e17af5e404ecbf7ee3b4c795b146c900c_gistfile1.ps1
<# These are the functions I use to update my configuration database. This is a custom database that I use to organize DSC configuration GUIDs and there associated servers. I track configuration versions and some other information. For other appliacations the queries would change, but the concept...
PowerShellCorpus/GithubGist/dfinke_064c149320244f62520c_raw_91ac3d66d0f0259085bfa31e6fd46132b6109e6a_MagicSquares.ps1
dfinke_064c149320244f62520c_raw_91ac3d66d0f0259085bfa31e6fd46132b6109e6a_MagicSquares.ps1
1..10 | ForEach { $r = 0..($_-1) -join '' $exp = "$($r)*9+$_" "{0,15}={1}" -f $exp, ($exp|Invoke-Expression) } '' 1..9 | ForEach { $r = 1..($_) -join '' $exp = "$($r)*8+$_" "{0,15}={1}" -f $exp, ($exp|Invoke-Expression) }
PowerShellCorpus/GithubGist/zachbonham_2635944_raw_ae1c17030bd71cbe23c9829a7d1b4e1bbe7763bf_remote.ps1
zachbonham_2635944_raw_ae1c17030bd71cbe23c9829a7d1b4e1bbe7763bf_remote.ps1
function invoke-remoteexpression($computer = “\\$ENV:ComputerName”, [ScriptBlock] $expression = $(throw “Please specify an expression to invoke.”), [switch] $noProfile , $username, $password) { $commandLine = “echo . | powershell “ if($noProfile) { $commandLine += “-NoProfile “ } ...
PowerShellCorpus/GithubGist/XPlantefeve_75bde89c6967569d218f_raw_e93d18d7c38b5cd8b59f1d4cccfb16459b712661_Convert-CSVtoXLS.ps1
XPlantefeve_75bde89c6967569d218f_raw_e93d18d7c38b5cd8b59f1d4cccfb16459b712661_Convert-CSVtoXLS.ps1
#requires -version 4.0 Function Convert-CSVtoXLS { <# .SYNOPSIS This function converts a CSV file to an Excel workbook. .DESCRIPTION Convert-CSVtoXLS converts a csv file to a Excel workbook. The first line of the CSV file is turned into a filtering header. Excel must be installed on the computer. .EXAMPLE P...
PowerShellCorpus/GithubGist/jstangroome_519103_raw_b0722820dc1ebe562f58c6761c0ee95e69c5e28b_Import-PSISEProfile.ps1
jstangroome_519103_raw_b0722820dc1ebe562f58c6761c0ee95e69c5e28b_Import-PSISEProfile.ps1
if ($psise) { if (!(test-path $profile)) { new-item $profile -fo -it file } $e = $psise.CurrentPowerShellTab.Files.Add($profile).Editor $col = $e.GetLineLength($e.LineCount)+1 $e.Select($e.LineCount,$col,$e.LineCount,$col) $e.InsertText("`n" + (new-object Net.WebClient).DownloadString( ...
PowerShellCorpus/GithubGist/pkskelly_e102177227b214500fff_raw_87713dab5af279d839fc35c0228e5d195fed72e6_TW-CreateBlankClientExtranetSite.ps1
pkskelly_e102177227b214500fff_raw_87713dab5af279d839fc35c0228e5d195fed72e6_TW-CreateBlankClientExtranetSite.ps1
# =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= # Script: TW-CreateBlankClientExtranetSite.ps1 # # Author: Pete Skelly # Twitter: ThreeWillLabs # http://www.threewill.com # # Description: Add a blank site coll...
PowerShellCorpus/GithubGist/bkeele_2491944_raw_7c48bbfec20e8b29a2db2b60a04f857ef2ae131f_PreDeploy.ps1
bkeele_2491944_raw_7c48bbfec20e8b29a2db2b60a04f857ef2ae131f_PreDeploy.ps1
Import-Module WebAdministration $port = 80 $ssl = $false $wa = Get-Website | Where {$_.Name -eq $OctopusWebSiteName} $ap = Get-WebAppPoolState | Where {$_.Name -eq $appPoolName} if($wa -eq $null) { write-host "no web application setup, creating..." if($ap -eq $null) ...
PowerShellCorpus/GithubGist/boblogdk_6258085_raw_96b9f9ad3da539146f8e8da1cf2f19723c88437b_gistfile1.ps1
boblogdk_6258085_raw_96b9f9ad3da539146f8e8da1cf2f19723c88437b_gistfile1.ps1
################################################################################################################################ # # # Generates script of database tables only ...
PowerShellCorpus/GithubGist/growse_4745746_raw_3e1780cd62d67eefe612f44dcd689b4ab51f3513_gistfile1.ps1
growse_4745746_raw_3e1780cd62d67eefe612f44dcd689b4ab51f3513_gistfile1.ps1
Add-Type -Assembly System.ServiceModel.Web,System.Runtime.Serialization function Read-Stream { PARAM( [Parameter(Position=0,ValueFromPipeline=$true)]$Stream ) process { $bytes = $Stream.ToArray() [System.Text.Encoding]::UTF8.GetString($bytes,0,$bytes.Length) }} function New-Json { [CmdletBinding()]...
PowerShellCorpus/GithubGist/peaeater_e1f6a611f61b893ca560_raw_73ff00f2f08a9e23d454ab21ffe8f2d76b817cbe_raw-ocr.ps1
peaeater_e1f6a611f61b893ca560_raw_73ff00f2f08a9e23d454ab21ffe8f2d76b817cbe_raw-ocr.ps1
<# Processes raw source pdfs, producing per page: 1 txt, 1 hocr, 1 jpg. Requires imagemagick w/ ghostscript, tesseract. Subscripts: pdf2png.ps1, ocr.ps1, hocr.ps1, png2jpg.ps1 #> param( [string]$indir = ".", [string]$outbase = $indir ) function WebSafe([string]$s) { return $s.ToLowerInva...
PowerShellCorpus/GithubGist/jpoehls_1281866_raw_c2f788bd05f2bc2242d7189060e301456caf9ac9_tortoise-svn.ps1
jpoehls_1281866_raw_c2f788bd05f2bc2242d7189060e301456caf9ac9_tortoise-svn.ps1
# Helper function for opening the Tortoise SVN GUI from a PowerShell prompt. # Put this into your PowerShell profile. # Ensure Tortoise SVN is in your PATH (usually C:\Program Files\TortoiseSVN\bin). function Svn-Tortoise([string]$Command = "commit") { <# .SYNOPSIS Launches TortoiseSVN with the given command....
PowerShellCorpus/GithubGist/smasterson_ea1fc73f439acb1ec90e_raw_41228f89752fe909381a80bcd58b926624f2c522_VeeamSingleBackupv8.ps1
smasterson_ea1fc73f439acb1ec90e_raw_41228f89752fe909381a80bcd58b926624f2c522_VeeamSingleBackupv8.ps1
# Load Veeam snapin Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue Clear-Host Write-Host "Veeam Single VM Backup Script`n" Write-Host "Notes:" Write-Host "VM must be explicitly defined in the job" Write-Host "VM can not be inherited by a folder, datastore or other object" Write-Host "else it w...
PowerShellCorpus/GithubGist/senpost_9514766_raw_dd8b97aa5ea867dd6004fade8c2fa520ba091ead_gistfile1.ps1
senpost_9514766_raw_dd8b97aa5ea867dd6004fade8c2fa520ba091ead_gistfile1.ps1
$tags = @" FFFEE000 FFFEE00D FFFEE0DD "@ $tags -split '\n' | foreach{ $_.Insert(4,', ') | echo }; #Formatted output will look like this <# FFFE, E000 FFFE, E00D FFFE, E0DD #>
PowerShellCorpus/GithubGist/stej_507000_raw_b60391568c1ede87d3f6a1e4d2d41c1ab03e31f8_table%20formatting,%20vomitting%20allowed.ps1
stej_507000_raw_b60391568c1ede87d3f6a1e4d2d41c1ab03e31f8_table%20formatting,%20vomitting%20allowed.ps1
if ( $psc -eq $null ) { $psc = $pscmdlet } ; if (-not $PSBoundParameters.psc) {$PSBoundParameters.add("psc",$psc)} if ( $image.count -gt 1 ) { [Void]$PSBoundParameters.Remove("Image") ; $image | ForEach-object {Save-Image -Image $_ @PSBoundParameters } ; return} if ($filename -...
PowerShellCorpus/GithubGist/pkirch_bc290caca7aa5e065ac0_raw_2bbc40b68e5bf17eba64780a9031300e9204dff6_MVA05-BlobSnapshot.ps1
pkirch_bc290caca7aa5e065ac0_raw_2bbc40b68e5bf17eba64780a9031300e9204dff6_MVA05-BlobSnapshot.ps1
# step 1: get file $blobFile = Get-AzureStorageBlob -Container source | Where-Object -Property Name -eq "version.txt" # step 2: create snapshot $cloudBlob = $blobFile.ICloudBlob $cloudBlob.CreateSnapshot() # step 3: get snapshots $snapshot = Get-AzureStorageBlob -Container source | Where-Object -Property Snap...
PowerShellCorpus/GithubGist/ssilva_e3c5f9eee2f26549adc2_raw_f93b452718ad76906ae2eec261ec92b8eb3c16ff_DisableEnableNetworkAdapter.ps1
ssilva_e3c5f9eee2f26549adc2_raw_f93b452718ad76906ae2eec261ec92b8eb3c16ff_DisableEnableNetworkAdapter.ps1
# Get the network adapter object $adapter = Get-WmiObject -Class Win32_NetworkAdapter | Where-Object {$_.Name -eq "TP-LINK Wireless USB Adapter"} # Disable it Write-Host -nonew "Disabling $($adapter.Name)... "; $result = $adapter.Disable() if ($result.ReturnValue -eq -0) { Write-Host "Success."; } els...
PowerShellCorpus/GithubGist/mitchelldavis_33570d3d31df70a76f9d_raw_bf61bb2bd4729f7f6545c7de095918e0ad1e016c_get-hash.ps1
mitchelldavis_33570d3d31df70a76f9d_raw_bf61bb2bd4729f7f6545c7de095918e0ad1e016c_get-hash.ps1
param( [string] $file = $(throw 'a filename is required'), [string] $algorithm = 'sha256' ) $fileStream = [system.io.file]::openread((resolve-path $file)) $hasher = [System.Security.Cryptography.HashAlgorithm]::create($algorithm) $hash = $hasher.ComputeHash($fileStream) $fileStream.close() $fileStream...
PowerShellCorpus/GithubGist/pkirch_5fa217a4b56d0cd215cf_raw_1d9a1f3122e3576a65d7fab55ebeaedac3c06fec_RelatedAzureVM.ps1
pkirch_5fa217a4b56d0cd215cf_raw_1d9a1f3122e3576a65d7fab55ebeaedac3c06fec_RelatedAzureVM.ps1
Get-Command -Module Azure -Noun AzureVM <# Output CommandType Name ModuleName ----------- ---- ---------- ...
PowerShellCorpus/GithubGist/acauamontiel_f801746c75b62b201faa_raw_6ffea5fdd129d50706a6800c88238d980fa5eaaa_replace.ps1
acauamontiel_f801746c75b62b201faa_raw_6ffea5fdd129d50706a6800c88238d980fa5eaaa_replace.ps1
$file = '.\fileName.lst' # Caminho relativo do arquivo $oldName = 'Old Name' # Nome a ser alterado $newName = Read-Host 'Novo nome' (gc $file).replace($oldName, $newName) | sc $file
PowerShellCorpus/GithubGist/ullet_47c738d52406c1f20391_raw_94b80b6d6d6217c71b0096c3f3614b5bfb4a199f_DoNotExit.ps1
ullet_47c738d52406c1f20391_raw_94b80b6d6d6217c71b0096c3f3614b5bfb4a199f_DoNotExit.ps1
# From Stack Overflow answer by Roman Kuzmin (http://stackoverflow.com/users/323582/roman-kuzmin) # to question @ http://stackoverflow.com/questions/9362722/stop-powershell-from-exiting param($Work) # restart PowerShell with -noexit, the same script, and 1 if (!$Work) { powershell -noexit -file $MyInvocati...
PowerShellCorpus/GithubGist/nolim1t_660449_raw_20c92fbf3a2c770a515c62a74bb2b6d99d713521_Tweet.ps1
nolim1t_660449_raw_20c92fbf3a2c770a515c62a74bb2b6d99d713521_Tweet.ps1
# This is a powershell script which uses # TwitProxy (https://twitproxy.heroku.com/) for updating twitter. # Twittering using Windows Powershel # Usage: .\Tweet.ps1 <the tweet> [System.Reflection.Assembly]::LoadWithPartialName("System.Web") | out-null $text = [System.Web.HttpUtility]::UrlEncode($args); # Use yo...
PowerShellCorpus/GithubGist/johnallers_4548e4316deff13da00b_raw_373486fa70c13923c9d7f1d107b761359b7520f5_Use-Impersonation.ps1
johnallers_4548e4316deff13da00b_raw_373486fa70c13923c9d7f1d107b761359b7520f5_Use-Impersonation.ps1
param( [String] $domain, [String] $username, [String] $password, [ScriptBlock] $scriptBlock ) <# .SYNOPSIS Impersonates a user and executes a script block as that user. This is an interactive script and a window will open in order to securely capture credentials. .EXAMPLE ...
PowerShellCorpus/GithubGist/crancker_5493489_raw_c3307609b0ca83d4675b1a7986b846ccf5e542af_deltemp.ps1
crancker_5493489_raw_c3307609b0ca83d4675b1a7986b846ccf5e542af_deltemp.ps1
Function delete{ Get-Childitem $Env:temp | Remove-Item -Recurse -Force write-host "All temp files have been successfuly deleted." } $select = Read-Host "Do you want to delete all TEMP files? (yes, no)" $temp = Get-Childitem $Env:temp $temp if ($select -eq "yes"){ delete } elseif ($select -eq "no"){ write...
PowerShellCorpus/GithubGist/nkrumm_7031035_raw_b67d590adf0eb54b59d882424c4484b82b85ce5d_gistfile1.ps1
nkrumm_7031035_raw_b67d590adf0eb54b59d882424c4484b82b85ce5d_gistfile1.ps1
# set this to your head node hostname (run hostname) HEAD_NODE_NAME=master if [ `hostname` = $HEAD_NODE_NAME ]; then NODES=`qconf -sel | grep -v $HEAD_NODE_NAME` for NODE in $NODES; do SCRIPT_PATH=`readlink -f $0` qsub -l h=$NODE $SCRIPT_PATH done else # YOUR COMMANDS YOU WA...
PowerShellCorpus/GithubGist/dfinke_4011813_raw_427c8da6f2c5e57855d974390ea9db694fde2939_gistfile1.ps1
dfinke_4011813_raw_427c8da6f2c5e57855d974390ea9db694fde2939_gistfile1.ps1
# Which do you think takes less time to multiply the #'s 1 to 55? function Test-Timings { param( $iterations=5, $type, $sb ) 1..$iterations | ForEach { $TotalMilliseconds = (Measure-Command {& $sb} ).TotalMilliseconds/1000 [pscustomob...
PowerShellCorpus/GithubGist/codecontemplator_4638774_raw_6199b18686c142c0a0dc229e2f3850f5784b83fa_hronparser.ps1
codecontemplator_4638774_raw_6199b18686c142c0a0dc229e2f3850f5784b83fa_hronparser.ps1
function Parse-String([ref]$lines, $indent) { $sb = New-Object System.Text.StringBuilder while($lines.Value[0] -match "(?<indent>^\t*)(?<value>.*)" -and $matches.indent.Length -eq $indent) { $lines.Value = $lines.Value[1..($lines.Value.Length)] $sb.AppendLine($matches.value) | Out-Null...
PowerShellCorpus/GithubGist/kujotx_5447088_raw_c1601652ccea7dd94048722a32bfa1e2ff18efe9_gistfile1.ps1
kujotx_5447088_raw_c1601652ccea7dd94048722a32bfa1e2ff18efe9_gistfile1.ps1
# from : http://blog.uwe.elflein.eu/?p=42 $check = Test-Path -PathType Container xyz if($check -eq $false){ New-Item 'xyz' -type Directory }
PowerShellCorpus/GithubGist/Touichirou_a1ca4c647012c6fc5901_raw_02a877ad9e21630f9a7f5b8d2acfcf081098b393_create-windows-user.ps1
Touichirou_a1ca4c647012c6fc5901_raw_02a877ad9e21630f9a7f5b8d2acfcf081098b393_create-windows-user.ps1
& net.exe user vagrant vagrant /add & net.exe user vagrant
PowerShellCorpus/GithubGist/gowland_3043141_raw_cf901573204b4291f1e112d2db408b3529ef0567_FileFTP.ps1
gowland_3043141_raw_cf901573204b4291f1e112d2db408b3529ef0567_FileFTP.ps1
#Upload the given file via FTP to the given server with the given credentials function FTPFile { Param( #Ensure $Filename exists and is not a folder [ValidateScript({Test-Path $_ -PathType 'Leaf'})] [string] $FilePath , [ValidateNotNullOrEmpty()] [string] $FTPUser , [ValidateNotNullOrE...
PowerShellCorpus/GithubGist/tkmtmkt_5786513_raw_701b1a84b8cb39868fc3c9e39193ef5c800492e4_gistfile1.ps1
tkmtmkt_5786513_raw_701b1a84b8cb39868fc3c9e39193ef5c800492e4_gistfile1.ps1
cd ~/apps/coherence/lib mvn install:install-file ` -D groupId=com.oracle.coherence ` -D artifactId=coherence ` -D version=3.7.1.7 ` -D file=coherence.jar ` -D packaging=jar ` -D generatePom=true
PowerShellCorpus/GithubGist/mrcaron_282014_raw_abd171a840cce0bd2c3d57c0d9908b539dc81056_Powershell_Prompt.ps1
mrcaron_282014_raw_abd171a840cce0bd2c3d57c0d9908b539dc81056_Powershell_Prompt.ps1
# Powershell Prompt $global:CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent() function prompt { $un = [Regex]::Match($CurrentUser.Name,"SOLIDWORKS\\+(.*)").Groups[1].Value $hn = [Net.DNS]::GetHostName() $host.ui.rawui.WindowTitle = $un + "@" + $hn #+ " Line: " + $host.UI.RawUI.CursorPo...
PowerShellCorpus/GithubGist/gravejester_f464ef9eaab17d30ff3b_raw_bc0d5b00374df796be5fcd57439442733ac9aff9_Get-WebFile.ps1
gravejester_f464ef9eaab17d30ff3b_raw_bc0d5b00374df796be5fcd57439442733ac9aff9_Get-WebFile.ps1
function Get-WebFile { <# .SYNOPSIS Download a file from the internet. .DESCRIPTION Download a file from the internet. .PARAMETER Url URL of file being downloaded .PARAMETER TargetPath Target path where the downloaded file will be saved. Defaults to the current folder. .PARAMETE...
PowerShellCorpus/GithubGist/VertigoRay_6091753_raw_c1bec64a3dfc875ca2356eda586f2926748fa890_gistfile1.ps1
VertigoRay_6091753_raw_c1bec64a3dfc875ca2356eda586f2926748fa890_gistfile1.ps1
[string] $Path = 'OU=foo,OU=test,DC=domain,DC=com' try { if (!([adsi]::Exists("LDAP://$Path"))) { Throw('Supplied Path does not exist.') } else { Write-Debug "Path Exists: $Path" } } catch { # If invalid format, error is thrown. Throw("Supplied Path is invalid.`n$_") }