full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/mgohmann_TCPoshUG/LCMApplyAndAutoCorrect.ps1
LCMApplyAndAutoCorrect.ps1
Configuration LCM { Node $AllNodes.NodeName { LocalConfigurationManager { ConfigurationMode = "ApplyAndAutoCorrect" ConfigurationModeFrequencyMins = 15 RefreshMode = "Push" RefreshFrequencyMins = 30 RebootNodeIfNeeded = $true CertificateId = "ID...
PowerShellCorpus/Github/mgohmann_TCPoshUG/DemoConfigData.ps1
DemoConfigData.ps1
# A Friendly document for storing configuration! <# VALID SERVER ROLES: "2008R2PrimaryADDC" "2008R2SecondaryADDC" "2008R2Server" "2008R2RDS" "2008R2SQL" "2008R2Exchange" "2008R2IIS" "2012R2PrimaryADDC" "2012R2SecondaryADDC" "2012R2Server" "2012R2SQL" "2012R2RDS" "2012R2Exchange" "2012R2IIS" #> #F...
PowerShellCorpus/Github/mgohmann_TCPoshUG/z_Run the resource.ps1
z_Run the resource.ps1
Configuration LCM { Node (hostname) { LocalConfigurationManager { ConfigurationMode = "ApplyAndMonitor" ConfigurationModeFrequencyMins = 1440 RefreshMode = "Push" RefreshFrequencyMins = 720 RebootNodeIfNeeded = $false } } } Configuratio...
PowerShellCorpus/Github/mgohmann_TCPoshUG/ConfigScript.ps1
ConfigScript.ps1
Configuration NetgainDSC { [CmdletBinding()] Param ( # Param help description [Parameter(Mandatory=$True,ParameterSetName='Default')] [PSCredential]$DomainCredential, # Param help description [Parameter(Mandatory=$True,ParameterSetName='Default')] [PSCredential]$SafeModeCredential, # Param help description ...
PowerShellCorpus/Github/mgohmann_TCPoshUG/z_CodeForTimeZone.ps1
z_CodeForTimeZone.ps1
# Default time zone... $TimeZone = "Pacific Standard Time" # Change it to this... $TimeZone = "Central Standard Time" #Get Write-Output @{TimeZone = (C:\windows\system32\tzutil.exe /g)} #Set C:\windows\system32\tzutil.exe /s $TimeZone #Test (C:\windows\system32\tzutil.exe /g) -eq $TimeZone
PowerShellCorpus/Github/mgohmann_TCPoshUG/Invoke-VMDesiredState.ps1
Invoke-VMDesiredState.ps1
Function Invoke-VMDesiredState { <# .Synopsis Invoke DSC to configure a VM. .DESCRIPTION Invoke DSC to configure a VM. .EXAMPLE 1. Generate the Config Mof 2. Generate the Schema Mof 3. Create the VMs (if applicable). 4. Use this function to apply both. #> [CmdletBinding()] Param ( [Par...
PowerShellCorpus/Github/Lee303_get-tree/get-tree.ps1
get-tree.ps1
function Get-Tree($Directory, $DepthChar = '') { $Output = @() if ($Directory -ne $null) { $Items = Get-ChildItem -Path $Directory -ErrorAction SilentlyContinue } else { $Items = Get-ChildItem -ErrorAction SilentlyContinue } $FileCount=0 foreach ($Item...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/Restart-AllTridion.ps1
Restart-AllTridion.ps1
"### Restart All Tridion ###" "Stopping All Tridion CM services" $runningServices = service TCMBCCOM, ` # TCMIMPEXP, ` TcmPublisher, ` TCMSearchHost, ` TcmSearchIndexer, ` TcmServiceHost, ` TCMWorkflow ` ...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
"C:\Users\dominic\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" # Add this directory to the path so we can just invoke scripts # directly if they are here. $psDir = split-path $profile if (-not $env:path.contains($psDir)) { $env:Path = $env:Path + ';' + $psDir } set-alias -name kt -value K...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/Kill-Tridion.ps1
Kill-Tridion.ps1
"Shutting down Tridion COM+ Application" $COMAdminCatalog = new-object -com COMAdmin.COMAdminCatalog $COMAdminCatalog.ShutdownApplication("SDL Tridion Content Manager")
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/ContentDeliveryProvisioning/addXpmToSite.ps1
addXpmToSite.ps1
param ( [parameter(Mandatory=$true)] [ValidateScript({Test-Path $_})] [string]$InetPub, [parameter(Mandatory=$true)] [ValidateScript({Test-Path $_})] [string]$InstallerHome, [parameter(Mandatory=$true)] [ValidateScript({Test-Path (split-path($_))})] [string]$Temp...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/ContentDeliveryProvisioning/xpmweb.ps1
xpmweb.ps1
# This script is to set up the XPM web service site. There is another script that injects the XPM settings into an existing web site. param ( [parameter(Mandatory=$true)] [ValidateScript({Test-Path $_})] [string]$InstallerHome, [parameter(Mandatory=$true)] [ValidateScript({Test-P...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/ContentDeliveryProvisioning/createWebSite.ps1
createWebSite.ps1
# Script to create a Tridion-enabled web site param( # Script control parameters [parameter(Mandatory=$false)] [switch]$NoIISReset = $false, # Main web site params [Parameter(Mandatory=$true, HelpMessage='The web site name for your main web site.')] [string]$MainWebSiteName, [Parameter(Mandatory=$false...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/ContentDeliveryProvisioning/MasterSetup.ps1
MasterSetup.ps1
param( [Parameter(Mandatory=$false, HelpMessage='Prefix to let you test the scripts in a different directory etc.')] [string]$testPrefix ) # Confirm destructive operation. Alternatively you could pass -NoClobber to createWebSite.ps1 $caption = "Confirm" $message = "This script will delete your websites. Do you ...
PowerShellCorpus/Github/DominicCronin_tridion-practice/TridionPowershellScripts/ContentDeliveryProvisioning/TridionConfigurationFunctions.ps1
TridionConfigurationFunctions.ps1
import-module reflection import-namespace System.Xml.Linq function GetDefaultACE { param( [string]$account, [System.Security.AccessControl.FileSystemRights]$rights ) # http://technet.microsoft.com/en-us/library/ff730951.aspx $InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]"Container...
PowerShellCorpus/Github/DominicCronin_tridion-practice/CreateTestContent/CreateTestContent.ps1
CreateTestContent.ps1
# Depends on PowerShell Reflection module (http://poshcode.org/search/Reflection) # Depends on Tridion Powershell Modules (http://code.google.com/p/tridion-powershell-modules/) $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition $core = Get-TridionCoreServiceClient Import-Module Tridion-CoreServ...
PowerShellCorpus/Github/johanbove_WindowsPowerShell/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
Write-Host "Hi Johan, welcome back!" ############# # Functions # ############# ## Figure out where I got these profile .ps1 file from ## ## Web Server ## http://technet.microsoft.com/en-us/library/ee692685.aspx function server{python -m http.server} ## Function to retrieve external IP address. ## the...
PowerShellCorpus/Github/Cerender_LoggedOnUser/ListLoggedOnUsers.ps1
ListLoggedOnUsers.ps1
$ErrorActionPreference = "Stop" $comps = Get-Content CRISUsers.txt FOREACH ($comp in $comps) { IF(Test-Connection -count 1 -quiet $comp){ TRY {$user = WMIC /NODE: $comp COMPUTERSYSTEM GET USERNAME} CATCH {$user = "ERROR"} FINALLY {"$comp = $user"} } ELSE { "$comp = Could ...
PowerShellCorpus/Github/Cerender_LoggedOnUser/UserCheck.ps1
UserCheck.ps1
<#------------------------------------------------------------------------------ Jason McClary mcclarj@mail.amc.edu 06 Oct 2016 Description: Check that all servers have correct users logged in. Arguments: None Tasks: - Check that all servers have corr...
PowerShellCorpus/Github/ShreyasRmsft_CustomScripts/myscript.ps1
myscript.ps1
mkdir d:\itworked
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_15_10_59_5/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.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 url: ...
PowerShellCorpus/Github/flofreud_KissPosh/DefaultProfile.ps1
DefaultProfile.ps1
Set-Location ~
PowerShellCorpus/Github/burrowyacookie_githubopdr4/OPDRACHT4/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/burrowyacookie_githubopdr4/OPDRACHT4/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/burrowyacookie_githubopdr4/OPDRACHT4/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/IgorM198005_Contractors/Contractors/AppPackages/Contractors_1.0.12.0_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/mrokt_HackathonAnket/Anket_Sistem/packages/EntityFramework.5.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' } if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 ))) { $thisModuleManifest = 'EntityFramework.PS3.psd1' } else { $thisModuleManifest = 'EntityFramework.psd1' } $thisModule...
PowerShellCorpus/Github/mrokt_HackathonAnket/Anket_Sistem/packages/EntityFramework.5.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project) { $appDomain = [AppDomain]::CreateDomain( 'EntityFramework.PowerShell', $null, (New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' })) ...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.1.9.1/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.1.9.1/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.1.9.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/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/Modernizr.2.6.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/Modernizr.2.6.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/Modernizr.2.6.2/Tools/common.ps1
common.ps1
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) { try { $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js") } catch { # _references.js file not found return } if ($referencesFileProject...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/EntityFramework.5.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' } if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 ))) { $thisModuleManifest = 'EntityFramework.PS3.psd1' } else { $thisModuleManifest = 'EntityFramework.psd1' } $thisModule...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/EntityFramework.5.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project) { $appDomain = [AppDomain]::CreateDomain( 'EntityFramework.PowerShell', $null, (New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' })) ...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.UI.Combined.1.8.24/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $juiFileNameRegEx
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.UI.Combined.1.8.24/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $juiFileNameRegEx ...
PowerShellCorpus/Github/ljmorsillo_LMSamples/C-sharp/HealthObservations/packages/jQuery.UI.Combined.1.8.24/Tools/common.ps1
common.ps1
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) { try { $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js") } catch { # _references.js file not found return } if ($referencesFileProject...
PowerShellCorpus/Github/grytulv_Powershell/New-TempFolder.ps1
New-TempFolder.ps1
#Adding comment New-Item C:\temp -ItemType Directory
PowerShellCorpus/Github/brian-swan_HDInsightDemoSQLPASS2013/deletecluster.ps1
deletecluster.ps1
#This script deletes a cluster. You need to provide the cluster name and the associated subscription. Remove-AzureHDInsightCluster -Name "cluster_name" -Subscription "subscription_name"
PowerShellCorpus/Github/brian-swan_HDInsightDemoSQLPASS2013/uploaddata.ps1
uploaddata.ps1
#This script uploads data from a local directory (C:\rawflightdelaydata) to an existing #container (specifed by $Container) within an existing storage account (specifed by $StorageAccountName) $StorageAccountName = "your_storage_account_name" $Container = "your_container_name" $DataDir = "C:\rawflightdelaydata\" ...
PowerShellCorpus/Github/brian-swan_HDInsightDemoSQLPASS2013/createnewcluster.ps1
createnewcluster.ps1
#This script creates a new Azure HDInsight cluster. #You will need to supply basic information for creating a cluster by setting values for variables below. #Subscription name was set when you created your Windows Azure subscription. #If you don't know your subscription name, you can find it by logging into the Az...
PowerShellCorpus/Github/brian-swan_HDInsightDemoSQLPASS2013/getaveragedelays.ps1
getaveragedelays.ps1
#This script runs 3 hive jobs in an HDInsight cluster (for more readable queries, see the hivequeries.hql file). #The first query creates a table based on a set of .csv files. #The second query creates a second table by cleansing data from the first table. #The third query calculates the average weather delay by air...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1489521936798/.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/Kordeliya_netlabs-task10/Zueva_Natalia_ORM/packages/EntityFramework.SqlServerCompact.6.1.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Add-EFDefaultConnectionFactory $project 'System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework' -ConstructorArguments 'System.Data.SqlServerCe.4.0' Add-EFProvider $project 'System.Data.SqlServerCe.4.0' 'System.Data.Entity.SqlServerCompact.SqlCe...
PowerShellCorpus/Github/Kordeliya_netlabs-task10/Zueva_Natalia_ORM/packages/Microsoft.SqlServer.Compact.4.0.8876.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) Import-Module (Join-Path $toolsPath VS.psd1) $nativeBinDirectory = Join-Path $installPath "NativeBinaries" if ($project.Type -eq 'Web Site') { $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $binDirectory = Jo...
PowerShellCorpus/Github/Kordeliya_netlabs-task10/Zueva_Natalia_ORM/packages/Microsoft.SqlServer.Compact.4.0.8876.1/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) Import-Module (Join-Path $toolsPath VS.psd1) if ($project.Type -eq 'Web Site') { $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $binDirectory = Join-Path $projectRoot "bin" $libDirectory = Join-Path $inst...
PowerShellCorpus/Github/Kordeliya_netlabs-task10/Zueva_Natalia_ORM/packages/EntityFramework.6.1.3/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 # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/Kordeliya_netlabs-task10/Zueva_Natalia_ORM/packages/EntityFramework.6.1.3/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/Lazer5L_PlexBackup/PSPlexBackup.ps1
PSPlexBackup.ps1
# PSPlexBackup.ps1 $Date = Get-Date -UFormat "%Y%m%d" $PlexSource = “C:\Plex Media Server” $BackupDest = “D:\Backup\” $PlexXD = $PlexSource + “cache” $PlexDest = $BackupDest + “PMS” $PlexLog = $BackupDest + “PMSLog.txt” $ZipDest = $BackupDest + “*” $ZipFile = $BackupDest + “PlexBK” + $Date + “.7z” Stop-S...
PowerShellCorpus/Github/PechaYAlex_YelpDataAnlys_Vis/YelpDataAnlys_Vis-master/JsonPractice/packages/Newtonsoft.Json.6.0.8/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/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWin...
PowerShellCorpus/Github/PechaYAlex_YelpDataAnlys_Vis/YelpDataAnlys_Vis-master/YelpDataAnalyse/packages/Newtonsoft.Json.6.0.8/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/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWin...
PowerShellCorpus/Github/PechaYAlex_YelpDataAnlys_Vis/YelpDataAnlys_Vis-master/YelpDataAnalyse/packages/jQuery.2.1.4/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/PechaYAlex_YelpDataAnlys_Vis/YelpDataAnlys_Vis-master/YelpDataAnalyse/packages/jQuery.2.1.4/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/PechaYAlex_YelpDataAnlys_Vis/YelpDataAnlys_Vis-master/YelpDataAnalyse/packages/jQuery.2.1.4/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/JayPowerUser_Au-Psake/update_all.ps1
update_all.ps1
# AU Packages Template: https://github.com/majkinetor/au-packages-template param([string[]] $Name, [string] $ForcedPackages, [string] $Root = $PSScriptRoot) if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 } $Options = [ordered]@{ Timeout = 100 ...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/psake.ps1
psake.ps1
$verbosepreference = 'Continue' $ProjectRoot = $here Task Default -Depends Push-Chocolatey-Packages Task -name Init -description 'Set working directory' { $ProjectRoot = $here Write-Verbose "Begining Init Setting working directory" CD $ProjectRoot } Task -Name ConfigGit -description 'Con...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/build.ps1
build.ps1
param ($Task = 'Default') Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null $modules = @('psake',,'au') Foreach ($Module in $modules) { Install-module $module -scope CurrentUser -force Get-command -module $module } $Global:here = Split-Path -Parent $MyInvocation.MyCommand.Path Invoke-ps...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/RProject/update.ps1
update.ps1
import-module au $releases = 'http://cran.at.r-project.org/bin/windows/base/' function global:au_SearchReplace { @{ 'tools\chocolateyInstall.ps1' = @{ "(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'" "(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'" ...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/RProject/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file: # $f='c:\path\to\thisFile.ps1' # gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f ## NOTE: In 80-90% of the c...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/RProject/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'; $packageName= 'RProject' $fileType = 'exe' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $url32 = 'https://cran.r-project.org/bin/windows/base/R-3.4.0-win.exe' $checksum32 = '0064cc4c04b9935210f6b0a0d9b6e3bb41b022e279628549003cc95f26faddbe' $c...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/hexchat/update.ps1
update.ps1
import-module au $releases = 'https://hexchat.github.io/downloads.html' function global:au_SearchReplace { @{ 'tools\chocolateyInstall.ps1' = @{ "(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'" "(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'" ...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/hexchat/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'; $packageName= 'hexchat' $fileType = 'exe' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $url32 = 'https://dl.hexchat.net/hexchat/HexChat%202.12.4%20x86.exe' $url64 = 'https://dl.hexchat.net/hexchat/HexChat%202.12.4%20x64.exe' $checksum32...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/iTunes/update.ps1
update.ps1
import-module au $releases = 'https://www.apple.com/itunes/download/' function global:au_SearchReplace { @{ 'tools\chocolateyInstall.ps1' = @{ "(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'" "(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'" ...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/iTunes/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$ErrorActionPreference = 'Stop' $packageName = 'iTunes' $fileType = 'msi' $silentArgs = '/qn /norestart' $url32 = 'https://secure-appldnld.apple.com/itunes12/091-02141-20170515-85982C48-3662-11E7-8E72-49792DBC0DB3/iTunesSetup.exe' $url64 = 'https://secure-appldnld.apple.com/itunes12/091-02135-20170...
PowerShellCorpus/Github/JayPowerUser_Au-Psake/automation/Psake-Helpers.ps1
Psake-Helpers.ps1
Function Invoke-CreateNewPackageProcess($RootDir) { }
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_14895489419132/.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/sebmatthews_PowerShell/RemoveAzureBlobs/RemoveAzureBlobs/Remove-AzureDemoSQLBlobs.ps1
Remove-AzureDemoSQLBlobs.ps1
Function Remove-AzureDemoSQLBlobs { <# .SYNOPSIS This function takes a collection of Azure storage blob objects and deletes them pemanently .DESCRIPTION We're using the pscmdlet.shouldprocess method to give us a confirm dialogue. It's totally unecessary but I do like it. In order to use the $...
PowerShellCorpus/Github/sebmatthews_PowerShell/SitesNWebs/SitesNWebs/Add-BulkSPWebs.ps1
Add-BulkSPWebs.ps1
# we're wrapping this up in a function slightly pointlessly really only to make it demonstrably reusable Function Add-BulkSPWebs { <# .SYNOPSIS Creates a specified number of webs in a site collection. .PARAMETER scname The name of the site collection in which the webs will be created. .PARAME...
PowerShellCorpus/Github/sebmatthews_PowerShell/SitesNWebs/SitesNWebs/Add-DemoSiteCollection.ps1
Add-DemoSiteCollection.ps1
# we're wrapping this up in a function slightly pointlessly only to make it demonstrably reusable Function New-SPDemoSiteCollection { <# .SYNOPSIS Creates a site collection in an overly complicated way for demo purposes. .PARAMETER scurl The URL of the site collection to create. .PARAMETER p...
PowerShellCorpus/Github/sebmatthews_PowerShell/SitesNWebs/SitesNWebs/Add-BulkSPLists.ps1
Add-BulkSPLists.ps1
Function Add-SPList { <# .SYNOPSIS Creates a list for demo purposes. .PARAMETER url The URL of the web in which to create the list. .PARAMETER listname The list name. .PARAMETER listdesc The list description. .PARAMETER listtype The .PARAMETER scname The name of the site coll...
PowerShellCorpus/Github/sebmatthews_PowerShell/RealDocumentGenerator/RealDocumentGenerator/New-WordDocumentWithContent.ps1
New-WordDocumentWithContent.ps1
None
PowerShellCorpus/Github/sebmatthews_PowerShell/ExportVisioShapes/ExportVisioShapes/ExportVisioShapes.ps1
ExportVisioShapes.ps1
Function Export-VisioShapesFromStencils { Param ( [Parameter(Mandatory=$True)] [string]$stencilsource, [Parameter(Mandatory=$True)] [string]$outputpath ) # fire up the visio com object and hide it from the UI $visio = New-Object -ComObject Visio.Application $visio.Visible = $false # of course, u...
PowerShellCorpus/Github/sebmatthews_PowerShell/SnapShotAzureVMs/SnapShotAzureVMs/RestoreAzureVM.ps1
RestoreAzureVM.ps1
# we've got multiple subscriptions against my account so we want to choose the right one $subs = Get-AzureSubscription | ?{$_.SubscriptionName -match "Visual"} Select-AzureSubscription -SubscriptionName $subs.SubscriptionName # this seems to be needed for the re-creation of the VM Set-AzureSubscription -Subscript...
PowerShellCorpus/Github/sebmatthews_PowerShell/SnapShotAzureVMs/SnapShotAzureVMs/BackupAzureVM.ps1
BackupAzureVM.ps1
# we've got multiple subscriptions against my account so we want to choose the right one $subs = Get-AzureSubscription | ?{$_.SubscriptionName -match "Visual"} Select-AzureSubscription -SubscriptionName $subs.SubscriptionName #REGION kickassfunctions Function Start-BackupVirtualMachineDisk { Param ( [...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/08-Start-AllFarmServiceInstances.ps1
08-Start-AllFarmServiceInstances.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # this script will start the service instances for sharepoint. simples. # as we are doing things for learning purposes, this script is slightly unusual! # fo...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/03-Add-ServiceAccountToGroup.ps1
03-Add-ServiceAccountToGroup.ps1
Param ( [Parameter(Mandatory=$True)] [string]$Platform ) # this script adds accounts to the performance log group. simples. # let's clean the error variable as we are not starting a fresh session $Error.Clear() # setup the parameter file $parameterfile = "r:\powershell\xml\spconfig-"+$Platform+".xml...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/06-Add-ManagedAccountsToFarm.ps1
06-Add-ManagedAccountsToFarm.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # This script adds the managed accounts required in the farm. simples. # let's clean the error variable as we are not starting a fresh session $Error.Clear...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/13-Add-SiteCollections.ps1
13-Add-SiteCollections.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) #REGION functions Function Test-SnapIns { <# .Synopsis This function tests for and loads (if needed) specified Snap Ins .Description ...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/11-Set-WindowsServicesAccounts.ps1
11-Set-WindowsServicesAccounts.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # this script will update the windows service accounts. simples. # notice how with regions used and functions declared we can make things very neat, folded an...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/04-Add-ServersToNewOrExistingFarm.ps1
04-Add-ServersToNewOrExistingFarm.ps1
 Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform, [Parameter(Mandatory=$False)] [switch]$InitDatabase, [Parameter(Mandatory=$false)] [switch]$rebuild ) # this script will setup the initial sharepoint c...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/05-Set-HealthJobAndLogging.ps1
05-Set-HealthJobAndLogging.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # this script disables the health jobs that are not needed in a demo environment and setsup logging. simples. # let's clean the error variable as we are not...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/12-Create-SPContentDBandWebApplications.ps1
12-Create-SPContentDBandWebApplications.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) #REGION Kick Ass Functions Function Write-Line { # an easier way to write a blank line to the console to help format script output Write-Host '' } ...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/10-Add-SearchServiceToFarm.ps1
10-Add-SearchServiceToFarm.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) <# this script will setup the search service for sharepoint. simples. this script assumes a single database server, a further script will be required to sc...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/07-Add-ApplicationPoolsToFarm.ps1
07-Add-ApplicationPoolsToFarm.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # this script creates the required application pools. simples. # new thinking (2013/2016) suggests that Search should have two application pools (admin and qu...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/01-Set-SQLAlias.ps1
01-Set-SQLAlias.ps1
Param ( [Parameter(Mandatory=$True)] [string]$Platform ) # this script sets the sql server alias from the config file by adding registry keys. simples. # let's clean the error variable as we are not starting a fresh session $Error.Clear() # setup the parameter file $parameterfile = "r:\powershell\xm...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/09-Add-ServiceApplicationsToFarm.ps1
09-Add-ServiceApplicationsToFarm.ps1
Param ( [Parameter(Mandatory=$True, HelpMessage="You must provide a platform suffix so the script can find the paramter file!")] [string]$Platform ) # this script enables the remaining required service applications. simples. # as we are doing things for learning purposes, this script is slightly unusual! ...
PowerShellCorpus/Github/sebmatthews_PowerShell/SPInstallerLite (2016)/SPInstallerLite (2016)/deploy/02-Add-LocalAdminAccounts.ps1
02-Add-LocalAdminAccounts.ps1
Param ( [Parameter(Mandatory=$True)] [string]$Platform ) # This script adds accounts required in the farm to the local admins group. simples. # let's clean the error variable as we are not starting a fresh session $Error.Clear() # setup the parameter file $parameterfile = "r:\powershell\xml\spconfig...
PowerShellCorpus/Github/sebmatthews_PowerShell/ListInstalledKBs/ListInstalledKBs/Start-ListWindowsKBs.ps1
Start-ListWindowsKBs.ps1
Function Start-ListInstalledKBs { $updateobject = New-Object -comobject “Microsoft.Update.Searcher” $allupdates = $updateobject.QueryHistory(0,$updateobject.GetTotalHistoryCount()) $KBoutput = @() $Regexpattern = “KB\d*” Foreach ($update in $allupdates) { $KBname = $update.Title $KBid = $KBname | ...
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1489457137828/.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/telv1n_powershell/Excel_DriveInfo.ps1
Excel_DriveInfo.ps1
# Code for creating an excel file and populating it with information about the drives on each # computer name specified in a given file. # This file demonstrates creating an excel document and filling it with information dynamically from several computers on the network. # Very useful script that can be adapted ...
PowerShellCorpus/Github/cmatskas_EF.GenericRepository/EF.GenericRepository.Test/packages/EntityFramework.6.1.0/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 # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/cmatskas_EF.GenericRepository/EF.GenericRepository.Test/packages/EntityFramework.6.1.0/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/cmatskas_EF.GenericRepository/EF.GenericRepository/packages/EntityFramework.6.1.0/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 # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/cmatskas_EF.GenericRepository/EF.GenericRepository/packages/EntityFramework.6.1.0/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/loneferret_ps-Dsplit/v10-splitTest.ps1
v10-splitTest.ps1
Param( [parameter(Mandatory=$true)][string]$SourceFile, [parameter(Mandatory=$true)][int]$numberOfSplits, [parameter(Mandatory=$true)][string]$EndLocation, [parameter(ParameterSetName='Scan', Mandatory=$false)][bool]$ScanFile=$false, [parameter(ParameterSetName='Scan', Mandatory=$fal...
PowerShellCorpus/Github/ohtake_scr2012-votes/scr2012-votes.ps1
scr2012-votes.ps1
$baseUri = "http://sanriocharacterranking.com/" $lowerUri = $baseUri + "rankingall.php" $date = (Get-Date).Date function wget([String]$uri) { $wc = New-Object Net.WebClient $wc.Encoding = [Text.Encoding]::UTF8 $wc.DownloadString($uri) } function new-resultline([int]$rank, [int]$id, [string]$name...
PowerShellCorpus/Github/ryanvz_windows_bootstrapper/bootstrap.ps1
bootstrap.ps1
# Get Chocolatey if(-Not (Test-Path env:ChocolateyInstall)) { echo "Installing Chocolatey" iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) } choco install git DotNet4.5 microsoft-build-tools windows-sdk-8.0 aspnetmvc4.install webdeploy NuGet.CommandLine ruby1.9 ruby...
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_Provision_2017_4_26_15_47_16/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.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 url: ...