full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/onurgoker_TFS-Test/MVCTFSSample/packages/jQuery.1.7.1.1/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/jbpierce87_Vfiler_Vol_Creation/volume_creation_fit.ps1
volume_creation_fit.ps1
###==== Set Variables ====### $Source = $na002 $Vfiler = "vffit8x" $Dest = $fitn09p028 ###==== Set Dest aggr ====### $aggr = "aggr1" ###==== Get Volumes from Source ====### $source_vols = Get-NaVol -Controller $Source | ? {$_.OwningVfiler -eq "$Vfiler"} | ? {$_.CloneParent -eq $null} | ? {$_.Name...
PowerShellCorpus/Github/NUCIA_PS-UserAdd/UserAdd.ps1
UserAdd.ps1
Param($csv,[switch]$help) # Define parameters to expect. import-module ActiveDirectory # Include a goldmine of cmdlets. # VARIABLES/OBJECTS $Class = "User" # Define type of object being added. $dc = "dc=steal,dc=lan" # Define domain. $ou = "ou=Students" # Define OU. $exDate = get-date (get-date).AddDays(120) ...
PowerShellCorpus/Github/ericgentry_Write-HelloWorld/Write-HelloWorld.ps1
Write-HelloWorld.ps1
write-output "Hello World!" write-output " "
PowerShellCorpus/Github/stijnv1_HyperVScripts/VMReplicaScripts/VMReplicaScripts/GetVMReplicaOverview.ps1
GetVMReplicaOverview.ps1
# # GetVMReplicaOverview.ps1 # param ( [Parameter(Mandatory=$True)] [string]$ClusterName ) $nodes = Get-Cluster $ClusterName | Get-ClusterNode $VMReplicas = @() $VMReplicasMeasure = @() $VMReplicaOverview = @() foreach ($node in $nodes) { $VMReplicas += Get-VMReplication -ComputerName $n...
PowerShellCorpus/Github/stijnv1_HyperVScripts/VMReplicaScripts/VMReplicaScripts/MonitorandResumeVMReplicas.ps1
MonitorandResumeVMReplicas.ps1
# # MonitorandResumeVMReplicas.ps1 # param ( [Parameter(Mandatory=$True)] [string]$ClusterName ) $nodes = Get-Cluster $ClusterName | Get-ClusterNode $VMReplicas = @() $VMReplicasMeasure = @() $VMReplicaOverview = @() foreach ($node in $nodes) { $VMReplicas += Get-VMReplication -ComputerN...
PowerShellCorpus/Github/aidancasey_azure-webapi-blue-green/Run.ps1
Run.ps1
$ScriptDirectory = Split-Path $MyInvocation.MyCommand.Path . (Join-Path $ScriptDirectory /scripts/upgrade-db.ps1) . (Join-Path $ScriptDirectory /scripts/azure-commands.ps1) . (Join-Path $ScriptDirectory /scripts/public-ip-settings.ps1) Function Create-New-Stack() { $resourceGroupName = "CustomerServiceS...
PowerShellCorpus/Github/aidancasey_azure-webapi-blue-green/runTests.ps1
runTests.ps1
cd C:\Code\ADCommon-AzureDeploy Invoke-Pester
PowerShellCorpus/Github/aidancasey_azure-webapi-blue-green/spec/e2e.Tests.ps1
e2e.Tests.ps1
$scriptPath = "C:\Code\ADCommon-AzureDeploy\Run.ps1" . $scriptPath Describe 'CreateNewStack' { It 'Should create a new website called AidanADCommon with one or more instances' { Create-New-Stack Switch-AzureMode AzureServiceManagement $website = Get-AzureWebsite -Name AidanADCommon...
PowerShellCorpus/Github/aidancasey_azure-webapi-blue-green/scripts/azure-commands.ps1
azure-commands.ps1
function SetSubscriptionInfo([string]$publishFile, [string]$subscriptionName) { Import-AzurePublishSettingsFile $publishFile Select-AzureSubscription $subscriptionName Add-AzureAccount } function Create-Stack([string]$resourceGroupName, [string]$templateFile , [string]$templateParameterFile,[string]$lo...
PowerShellCorpus/Github/aidancasey_azure-webapi-blue-green/scripts/public-ip-settings.ps1
public-ip-settings.ps1
Function Get-MyPublicIP { (Invoke-WebRequest -Uri ifconfig.me).RawContent -match "\b(?:\d{1,3}\.){3}\d{1,3}\b" | Out-Null $matches | select -ExpandProperty Values }
PowerShellCorpus/Github/jamiewbryant_VSTechAcademy1/WebApplication1/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/jamiewbryant_VSTechAcademy1/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/jamiewbryant_VSTechAcademy1/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/chrislockard_Winadminorim/Winadminorim.ps1
Winadminorim.ps1
<# Copyright (C) 2014 Christopher Lockard 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, dis...
PowerShellCorpus/Github/musicislife08_NGMX/Frontend/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/musicislife08_NGMX/Frontend/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/musicislife08_NGMX/Frontend/packages/Newtonsoft.Json.6.0.4/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Examples/File-Tasks.ps1
File-Tasks.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module "$here\..\Task-Runner" $Tasks = @(@{ Path = "Get.Filename" Action = { return Read-Host "Please enter a filename" } }, @{ Path = "Create.File" Skip = { Param([hashtable]$ResultTree) return Test-...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-Task.ps1
Start-Task.ps1
function Start-Task { Param( [ValidateScript({Is-Task $_})] [hashtable]$Task, [hashtable]$ResultTree = @{}, [hashtable]$Colors = @{}, [int]$SubtaskLevel = 0 ) $Path = $Task.Path $Alias = if ($Task.Alias) {$Task.Alias} else {$Task.Path} $Description...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Write-Color.Tests.ps1
Write-Color.Tests.ps1
InModuleScope Task-Runner { Describe "the Write-Color function" { Mock Write-Host {} It "string writes once" { $Message = "Hello world!" Write-Color $Message Assert-MockCalled "Write-Host" -Exactly 1 -Scope It } It "list writs n times" { ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-Task.Tests.ps1
Start-Task.Tests.ps1
InModuleScope Task-Runner { Describe "the Start-Task function" { Mock Write-Host {$Script:HostOutput += $Object} It "runs a task" { $Script:HostOutput = "" $Task = @{ Path = "Write.Hello" Action = {Write-Host "Hello"} } ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-TaskList.Tests.ps1
Start-TaskList.Tests.ps1
InModuleScope Task-Runner { Describe "the Start-TaskList function" { It "returns action and confirmation results" { Mock Write-Host {} Mock Read-Host {"John Doe"} $Task = @{ Path = "Get.User.Name" Action = {Read-Host} ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-TaskVerification.ps1
Start-TaskVerification.ps1
function Start-TaskVerification { Param( [hashtable[]]$Subtasks, [hashtable]$ResultTree, [object]$Result, [hashtable]$Arguments, [int]$SubtaskLevel = 0 ) $Tasks = @($Subtasks | % {@{ Path = $_.Path Alias = "Verification Step: $($_.Path)" ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Is-Task.Tests.ps1
Is-Task.Tests.ps1
InModuleScope Task-Runner { Describe "the Is-Task function" { It "returns true on all mandatory keys existing" { Is-Task @{Path = "Print.Hello"; Action = {Write-Host "Hello"}} } It "returns false on not all mandatory keys existing" { Is-Task @{Path = "Print.Hell...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Write-Color.ps1
Write-Color.ps1
function Write-Color { <# .SYNOPSIS Writes text to the host environment in the specified color .PARAMETER Text A string or a hashtable, or a list of strings and hashtables .EXAMPLE # Write "Hello world!" in the default color. Write-Color "Hello world!" .EXAMPLE # Write "Hello world!" in red. Write-Colo...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-TaskVerification.Tests.ps1
Start-TaskVerification.Tests.ps1
InModuleScope Task-Runner { Describe "the Start-TaskVerification function" { It "returns tree" { Mock Write-Host {} $Subtasks = @(@{ Path = "Is.NotBlank" Test = { Param([hashtable]$Tree, $Value) return ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Start-TaskList.ps1
Start-TaskList.ps1
function Start-TaskList { Param( [hashtable[]]$Tasks, [ValidateScript({Is-ResultTree $_})] [hashtable]$ResultTree = @{}, [hashtable]$Colors = @{}, [int]$SubtaskLevel = 0 ) if (!$Colors.Alias) {$Colors.Alias = "Green"} if (!$Colors.Error) {$Colors.Error ...
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Is-ResultTree.ps1
Is-ResultTree.ps1
function Is-ResultTree { Param( [hashtable]$ResultTree ) if ($ResultTree -eq $null) { return $false } return $true }
PowerShellCorpus/Github/CossetteEric_Task-Runner/Functions/Is-Task.ps1
Is-Task.ps1
function Is-Task { Param( [hashtable]$Task ) return @("Path", "Action") | % {$HasAll = $true} {$HasAll = $HasAll -and $Task.ContainsKey($_)} {$HasAll} }
PowerShellCorpus/Github/seeramkirankumar48_github.iorepo/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/seeramkirankumar48_github.iorepo/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/Azure-Samples_powerbi-powershell/rebindReport.ps1
rebindReport.ps1
# This sample script calls the Power BI API to progammatically clone a SOURCE report to a # TARGET report in the Power BI service. The clone can either be based off of the same # dataset or a new dataset # For documentation, please see: # https://msdn.microsoft.com/en-us/library/mt784674.aspx # Instructions:...
PowerShellCorpus/Github/Azure-Samples_powerbi-powershell/manageRefresh.ps1
manageRefresh.ps1
# This sample script calls the Power BI API to progammtically trigger a refresh for the dataset # It then calls the Power BI API to progammatically to get the refresh history for that dataset # For full documentation on the REST APIs, see: # https://msdn.microsoft.com/en-us/library/mt203551.aspx # Instructions: ...
PowerShellCorpus/Github/eedrah_EDAGroupProject-Zoo/Zoo/packages/EntityFramework.6.1.2/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa2AYJKoZIhvcNAQcCoIIayTCCGsUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/eedrah_EDAGroupProject-Zoo/Zoo/packages/EntityFramework.6.1.2/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/Conan1989_BulkPsExec/BulkPsExec.ps1
BulkPsExec.ps1
<# Bullk psexec into computers psexec - https://technet.microsoft.com/en-us/sysinternals/psexec.aspx #> $ListOfHostnames = Get-Content -LiteralPath "C:\Scripts\Bulk PsExec\Hostnames.txt" $WorkingFolderLocal = "C:\Temp" #WorkingFolder for the remote target computers $FileToCopyLocally = "\\bdc-bks01\ict\SOFTWA...
PowerShellCorpus/Github/asterisk9101_Create-ExcelEvidence/Create-ExcelEvidence.ps1
Create-ExcelEvidence.ps1
param($Path) function logger($msg) { $msg = (Get-Date -Format "u") + "`t" + $msg Write-Host $msg } logger "Processing..." Add-Type -AssemblyName System.Windows.Forms $Excel = New-Object -ComObject Excel.Application $Excel.Visible = $true logger "Connected to Excel." if ($path) { try { ...
PowerShellCorpus/Github/nus-continuous-delivery_cd_windows/install_net4.ps1
install_net4.ps1
$NetFx4ClientUrl = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe' $NetFx4FullUrl = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe' $NetFx4Path = 'c:\vagrantshared\resources\NetFx4' $Ne...
PowerShellCorpus/Github/nus-continuous-delivery_cd_windows/install_chocolatey.ps1
install_chocolatey.ps1
$ChocoInstallPath = "$env:SystemDrive\Chocolatey\bin" # Put chocolatey on the MACHINE path, vagrant does not have access to user environment variables $envPath = $env:PATH if (!$envPath.ToLower().Contains($ChocoInstallPath.ToLower())) { Write-Host "PATH environment variable does not have `'$ChocoInstallPath`'...
PowerShellCorpus/Github/yohantheman_sppoctest/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'spopoc', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = ...
PowerShellCorpus/Github/yohantheman_sppoctest/bin/Debug/staging/sppoctest/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'spopoc', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = ...
PowerShellCorpus/Github/peetersm12_Office365Groups-GUI/Start-Office365GUI.ps1
Start-Office365GUI.ps1
<# .SYNOPSIS This GUI will let you view active and deleted Office365 Groups and restore deleted groups .DESCRIPTION This GUI tool was inspired by the PoshPAIG tool created by Boe Prox. .LINK Maarten Peeters Blog - http://www.sharepointfire.com Boe Prox Blog - https://l...
PowerShellCorpus/Github/peetersm12_Office365Groups-GUI/HelpFiles/About.ps1
About.ps1
Function Open-About { $rs=[RunspaceFactory]::CreateRunspace() $rs.ApartmentState = "STA" $rs.ThreadOptions = "ReuseThread" $rs.Open() $ps = [PowerShell]::Create() $ps.Runspace = $rs $ps.Runspace.SessionStateProxy.SetVariable("pwd",$pwd) [void]$ps.AddScript({ [xml]$xaml = @" <Window xmlns='htt...
PowerShellCorpus/Github/peetersm12_Office365Groups-GUI/HelpFiles/HelpOverview.ps1
HelpOverview.ps1
Function Open-Help { $rs=[RunspaceFactory]::CreateRunspace() $rs.ApartmentState = "STA" $rs.ThreadOptions = "ReuseThread" $rs.Open() $ps = [PowerShell]::Create() $ps.Runspace = $rs $ps.Runspace.SessionStateProxy.SetVariable("pwd",$pwd) [void]$ps.AddScript({ [xml]$xaml = @" <Window xmlns='http...
PowerShellCorpus/Github/openpublish_openpublishing-test.pt-br/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1 Download buildcore script to local echo "download build core script to local with source ur...
PowerShellCorpus/Github/Fabian-Schmidt_chocolatey-packages/7-taskbar-tweaker/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
#Install-VirtualPackage '7-taskbar-tweaker.portable' '7-taskbar-tweaker.install'
PowerShellCorpus/Github/Fabian-Schmidt_chocolatey-packages/7-taskbar-tweaker.install/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$packageName = '7-taskbar-tweaker.install' $installerType = 'EXE' $url = 'http://rammichael.com/downloads/7tt_setup.exe' $silentArgs = '/S' $validExitCodes = @(0) Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_Backup-AzureServiceVM.ps1
sample_Backup-AzureServiceVM.ps1
workflow Backup-AzureServiceVM { Param ( [parameter(Mandatory=$true)] [String] $AzureConnectionName = 'Windows Azure Internal Consumption', [parameter(Mandatory=$true)] [String] $PSCredentialName = 'automationadmin@shzhailab.partner.onmschina.cn', ...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_Connect-Azure.ps1
sample_Connect-Azure.ps1
<# .SYNOPSIS Sets up the connection to an Azure subscription .DESCRIPTION WARNING: This runbook is deprecated. Please use OrgID credential auth to connect to Azure, instead of certificate auth using this runbook. You can learn more about using credential auth with Azure here: http://aka.ms/Sspv1l ...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_CertConnect-Azure.ps1
sample_CertConnect-Azure.ps1
workflow CertConnect-Azure { $AzureConnectionName = 'Windows Azure Internal Consumption' Connect-Azure -AzureConnectionName $AzureConnectionName Select-Azuresubscription -SubscriptionName $AzureConnectionName }
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_AADConnect-Azure.ps1
sample_AADConnect-Azure.ps1
workflow AADConnect-Azure { $AzureConnectionName = 'Windows Azure Internal Consumption' $Cred = Get-AutomationPSCredential -Name 'automationadmin@shzhailab.partner.onmschina.cn' add-azureaccount -Environment AzureChinaCloud -Credential $Cred Select-azuresubscription -subscriptionname $AzureConnecti...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_Start-AutomationChildRunbook.ps1
sample_Start-AutomationChildRunbook.ps1
<# .SYNOPSIS Starts an Azure Automation runbook job and either returns the job id or waits for the job to complete and returns the job output .DESCRIPTION This runbook starts a child runbook when called from a parent runbook. Requirements: 1. Azure Org Id credential asset in the Aut...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/Sample_Call-AzureVMBackup.ps1
Sample_Call-AzureVMBackup.ps1
workflow Test-AzureVMBackup { Param ( [parameter(Mandatory=$false)] [String] $AzureConnectionName = 'Windows Azure Internal Consumption', [parameter(Mandatory=$false)] [String] $PSCredentialName = 'automationadmin@shzhailab.partner.onmschina.cn', ...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_Start-RunBook.ps1
sample_Start-RunBook.ps1
workflow start-runbook { $AzureConnectionName = 'Windows Azure Internal Consumption' $Cred = Get-AutomationPSCredential -Name 'automationadmin@shzhailab.partner.onmschina.cn' add-azureaccount -Environment AzureChinaCloud -Credential $Cred Select-azuresubscription -subscriptionname $AzureConnectionN...
PowerShellCorpus/Github/shzhai_MVA-Azure-Automation-Service/sample_Call-AzureChildRunBook.ps1
sample_Call-AzureChildRunBook.ps1
workflow Call-AzureChildRunbook { $Cred = Get-AutomationPSCredential -Name "automationadmin@shzhailab.partner.onmschina.cn" Start-AutomationChildRunbook -AutomationAccountName 'shzhaiautomationaccount' ` -AzureOrgIdCredential $Cred ` -AzureSubscriptionName 'Windows Azure Internal Consumptio...
PowerShellCorpus/Github/Pytsh_packages/teeworlds/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$packageName = 'teeworlds' $url = 'http://www.teeworlds.com/files/teeworlds-0.6.2-win32.zip' $url64bit = 'http://www.teeworlds.com/files/teeworlds-0.6.2-win64.zip' $unzipLocation = '%ChocolateyInstall%\lib\mypackage' try { Install-ChocolateyZipPackage $packageName $url $unzipLocation $url64bit #Write-Choc...
PowerShellCorpus/Github/Pytsh_packages/fleex/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$packageName = 'fleex' $fileType = 'exe' $url = 'http://download.fleex.tv/player/fleex-latest.exe' $silentArgs = '/s' try { Install-ChocolateyPackage $packageName $fileType $silentArgs $url #Write-ChocolateySuccess $packageName } catch { Write-ChocolateyFailure $packageName "$($_.Exception.Messa...
PowerShellCorpus/Github/hanserikjensen_beta/powershell/MonitorDatacenterQueue.ps1
MonitorDatacenterQueue.ps1
<# .SYNOPSIS This script checks a queued blueprint job to ensure timely, successful execution. If the blueprint fails to complete within the threshold, a ticket is generated to Support .DESCRIPTION Author : Erik Jensen Last edit : 2/11/2016 Version : 0.1 .PARAMETER DataCenter The descripti...
PowerShellCorpus/Github/ratchetnclank_MetaScanTools/get-metascanlicense.ps1
get-metascanlicense.ps1
<# .SYNOPSIS Pulls the license information from the metascan api. .PARAMETER Computername Name of the metascan server .PARAMETER Port Port metascan is running on .PARAMETER https If the server is https enabled or not. .EXAMPLE Get-MetascanLicense -computername metascan.contoso.com -port 8008 .NOT...
PowerShellCorpus/Github/ratchetnclank_MetaScanTools/Get-MetascanStatistics.ps1
Get-MetascanStatistics.ps1
<# .SYNOPSIS Queries the specified metascan server and retrieves operational statistics .DESCRIPTION Queries the specified metascan server and retrieves operational statistics .EXAMPLE Get-MetascanStatstics -Computername "671630-lteitg04" -checkperiod 1 .NOTES #> function Get-MetascanStatstics{ ...
PowerShellCorpus/Github/ratchetnclank_MetaScanTools/get-metascanengines.ps1
get-metascanengines.ps1
<# .SYNOPSIS Queries the specified metascan server and retrieves operational statistics .DESCRIPTION Queries the specified metascan server and retrieves operational statistics .EXAMPLE Get-MetascanStatstics -Computername "671630-lteitg04" -checkperiod 1 .NOTES #> function Get-MetascanEngines{ ...
PowerShellCorpus/Github/ratchetnclank_MetaScanTools/Request-MetaScan.ps1
Request-MetaScan.ps1
<# .SYNOPSIS Scans a file and optionally will email report of infected files. .DESCRIPTION .PARAMETER File Full Path to file to be scanned. .PARAMETER MetascanServer IP or hostname of the metascan server .PARAMETER Port Port of Metascan server .EXAMPLE Request-MetaScan -file C:\temp\file.txt -m...
PowerShellCorpus/Github/benny-gold_slack-download-bots/Update-PoshBot.ps1
Update-PoshBot.ps1
function Update-PoshBot { [OutputType([Object])] Param ( [Parameter(Mandatory=$True,Position=1)] [string] $botConfigPath ) $botConfig = Get-Content $botConfigPath | convertfrom-json try { (gci $PSScriptRoot\coffee)+(gci $PSScriptRoot\po...
PowerShellCorpus/Github/benny-gold_slack-download-bots/powershell/Get-SlackTV.ps1
Get-SlackTV.ps1
function Get-SlackTV{ Param ( [Parameter(Mandatory=$true,Position=0)] $tvSearchString ) Import-Module "$psscriptroot\NZB-Powershell" -force $operationObject = New-Object System.Object $tvdbid = Get-TVDBId -APIKey $TVDBIDKey -show $tvsearchString Write-Verbose "$($IMDBID...
PowerShellCorpus/Github/benny-gold_slack-download-bots/powershell/Get-SlackMovie.ps1
Get-SlackMovie.ps1
function Get-SlackMovie{ Param ( [Parameter(Mandatory=$true,Position=0)] $movieSearchString ) Import-Module "$psscriptroot\NZB-Powershell" -force $operationObject = New-Object System.Object $IMDBID = Get-IMDBId -MovieName $movieSearchString Write-Verbose "$($IMDBID.titl...
PowerShellCorpus/Github/benny-gold_slack-download-bots/powershell/Get-ServiceHubot.ps1
Get-ServiceHubot.ps1
<# .Synopsis Gets service status for Hubot Script. .DESCRIPTION Gets service status for Hubot Script. .EXAMPLE Get-ServiceHubot -Name dhcp #> function Get-ServiceHubot { [CmdletBinding()] Param ( # Name of the Service [Parameter(Mandatory=$true)] $Name ...
PowerShellCorpus/Github/avincentelli_PSLabs/pslab1_avincentelli.ps1
pslab1_avincentelli.ps1
<## POWERSHELL LAB 1 ##> # Antonio Vincentelli <# Pre-Lab #> # 1. $PSVersionTable.PSVersion <# Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 494 # 2. (1) If on Win 8.0, upgrade to 8.1 or 10. (If 10, all set) (2) Install .NET 4.5. (3) If on Win 7, instal...
PowerShellCorpus/Github/mosesrenegade_CTRC/Invoke-Mimikatz.ps1
Invoke-Mimikatz.ps1
function Invoke-Mimikatz { <# .SYNOPSIS This script leverages Mimikatz 2.0 and Invoke-ReflectivePEInjection to reflectively load Mimikatz completely in memory. This allows you to do things such as dump credentials without ever writing the mimikatz binary to disk. The script has a ComputerName parameter which al...
PowerShellCorpus/Github/RepoTransferOrg_fenxu_repo_transfer_test_1/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/ApartmentClassEx/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/ApartmentClassEx/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/Exam2/Exam2/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/Exam2/Exam2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/Exam2/Exam2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/Mar22Exercise/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/Mar22Exercise/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question4/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question4/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question5/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question5/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question3/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/quinnbanet359_Web-Architecture-CIS-411-/HA1/Question3/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/benjguin_UnlockLuxury/scripts/powershell/create_hdinsight_cluster_linux.ps1
create_hdinsight_cluster_linux.ps1
#region init Import-Module azure echo $PSVersionTable Get-Module azure Switch-AzureMode -Name AzureResourceManager Add-AzureAccount #NB all $b_* variables are defined on my laptop. Replace with your own values in this script. #psedit C:\benjguin\_e\config\benjguin_config_in_PowerShell.ps1 $createCluster=$tr...
PowerShellCorpus/Github/benjguin_UnlockLuxury/scripts/powershell/create_hdinsight_cluster_windows.ps1
create_hdinsight_cluster_windows.ps1
#region init Import-Module azure echo $PSVersionTable Get-Module azure Switch-AzureMode -Name AzureResourceManager Add-AzureAccount #NB all $b_* variables are defined on my laptop. Replace with your own values in this script. #psedit C:\benjguin\_e\config\benjguin_config_in_PowerShell.ps1 $createCluster=$tr...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/VSCOM2015/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/UI PATH/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/microsoft.net4.5/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure w...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/xamarin/startInstall.ps1
startInstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/VSBuild/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/oracle/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure w...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/node/startInstall.ps1
startInstall.ps1
# Create temp directory New-Item "C:\SoftwaresDump\QTP12.5" -ItemType Directory -ErrorAction SilentlyContinue # Download (New-Object System.Net.WebClient).DownloadFile("http://artifacts.g7crm4l.org/softwares/node-v6.9.2-x64.msi", "C:\SoftwaresDump\QTP12.5\node-v6.9.2-x64.msi") # Install Start-Process "...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/vspro2015/startinstall.ps1
startinstall.ps1
[CmdletBinding()] param( ) ################################################################################################### # # PowerShell configurations # # NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure. # This is necessary to ensure we capture errors...
PowerShellCorpus/Github/yashg7cr_artifacts/devtest/TFS/startInstall.ps1
startInstall.ps1
$NewDIR = "C:\SoftwaresDump\QTP12.5" $SoftwareWebLink = "https://download.microsoft.com/download/a/e/1/ae184ba4-5926-4be6-a036-17b318960453/tfsserver2017.1.exe" $SoftwarePath = "C:\SoftwaresDump\QTP12.5\tfsserver2017.1.exe" # Create temp directory New-Item "C:\SoftwaresDump\QTP12.5" -ItemType Director...