full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/sharper-library_Sharper.C.Function/ci.ps1 | ci.ps1 | $TestsRegex = '\.Tests$'
function AllProjects() {
Get-ChildItem */project.json
}
function PackageProjects() {
AllProjects | Where {$_.Directory.Name -notmatch $TestsRegex}
}
function TestProjects() {
AllProjects | Where {$_.Directory.Name -match $TestsRegex}
}
function CleanCmd() {
Al... |
PowerShellCorpus/Github/CSI-Windowscom_Bootstraps/ChocolateyPackaging.ps1 | ChocolateyPackaging.ps1 |
Function Console-Prompt {
Param( [String[]]$choiceList,[String]$Caption = "Please make a selection",[String]$Message = "Choices are presented below",[int]$default = 0 )
$choicedesc = New-Object System.Collections.ObjectModel.Collection[System.Management.Automation.Host.ChoiceDescription]
$choiceList | foreach {... |
PowerShellCorpus/Github/CSI-Windowscom_Bootstraps/QuickConfigPowerShell5.ps1 | QuickConfigPowerShell5.ps1 |
$Description = "Gets Powershell 5 onto your system and optionally installs all the latest DSC Resource Kit Modules"
$Changes = @"
NOTE: After any restarts initiated by the script, you must kick off the script again.
[1] Sets PowerShell Execution Policy to "RemoteSigned"
[2] Installs .NET 4.5.1 if not pr... |
PowerShellCorpus/Github/CSI-Windowscom_Bootstraps/ProcessMonitoring.ps1 | ProcessMonitoring.ps1 |
Function Console-Prompt {
Param( [String[]]$choiceList,[String]$Caption = "Please make a selection",[String]$Message = "Choices are presented below",[int]$default = 0 )
$choicedesc = New-Object System.Collections.ObjectModel.Collection[System.Management.Automation.Host.ChoiceDescription]
$choiceList | foreach {... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_Provision_2017_4_21_12_5_18/.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/jaden-young_213Home2/BaseballDB/packages/EntityFramework.6.1.1/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/jaden-young_213Home2/BaseballDB/packages/EntityFramework.6.1.1/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/jaden-young_213Home2/PersonnelDB/packages/EntityFramework.6.1.1/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/jaden-young_213Home2/PersonnelDB/packages/EntityFramework.6.1.1/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/tomlarse_CsFimRunProfileExecution/CsFimRunProfileExecution.ps1 | CsFimRunProfileExecution.ps1 | function RunMaRunProfile
{
param(
[string]$MAToRun,
[string]$ProfileToRun
)
$filter = "Name='" + $MAToRun + "'"
$MA = Get-WmiObject -Class MIIS_ManagementAgent -Namespace root/MicrosoftIdentityIntegrationServer -Filter $filter
$result = $MA.Execute($ProfileToRun)
... |
PowerShellCorpus/Github/Purclot_hello-world/Get-WindowsInventoryToClixml.ps1 | Get-WindowsInventoryToClixml.ps1 | <#
.SYNOPSIS
Collects comprehensive information about hosts running Microsoft Windows and saves the result to a file.
.DESCRIPTION
This script leverages the NetworkScan and WindowsInventory modules along with Windows Management Instrumentation (WMI) to scan for and collect comprehensive information about ho... |
PowerShellCorpus/Github/Purclot_hello-world/EnumSQLInstances.ps1 | EnumSQLInstances.ps1 | <#
.SYNOPSIS
Create Inventory of SQL Server in Network as Html
.DESCRIPTION
You as a DBA, do you know, where and how many SQL Server are running in your network? Are you sure ...?
Meanwhile several applications installs their own SQL Server (Express) instance and after some time
you could hav... |
PowerShellCorpus/Github/Purclot_hello-world/Get-SqlServerInventoryToClixml.ps1 | Get-SqlServerInventoryToClixml.ps1 | <#
.SYNOPSIS
Collects comprehensive information about SQL Server instances and their underlying Windows Operating System and saves the result to a file.
.DESCRIPTION
This script leverages the NetworkScan, SqlServerInventory, and WindowsInventory modules to scan for and collect comprehensive information abou... |
PowerShellCorpus/Github/Purclot_hello-world/SQLServerInventoryExcel.ps1 | SQLServerInventoryExcel.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$InputFileName,
[Parameter(Mandatory=$True,Position=2)]
[string]$DirectoryToSaveTo,
[Parameter(Mandatory=$True,Position=3)]
[string]$To,
[Parameter(Mandatory=$True,Position=4)]
[string]$From,
[Paramete... |
PowerShellCorpus/Github/Purclot_hello-world/SQLServerInventory/Convert-SqlServerInventoryClixmlToExcel.ps1 | Convert-SqlServerInventoryClixmlToExcel.ps1 | <#
.SYNOPSIS
Writes Excel files containing the Database Engine and Windows Operating System information from a SQL Server Inventory file created by Get-SqlServerInventoryToClixml.ps1.
.DESCRIPTION
This script loads a SQL Server Inventory file created by Get-SqlServerInventoryToClixml.ps1 and calls the Expor... |
PowerShellCorpus/Github/rcottrill_Azure/Set-WinRM.ps1 | Set-WinRM.ps1 | param
(
[Parameter(Mandatory = $true)]
[string] $HostName
)
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/rcottrill/Azure/master/Set-WinRM.ps1" -OutFile "$env:temp\ConfigureWinRM.ps1"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/rcottrill/Azure/master/winrmconf.cmd" -OutFile "$e... |
PowerShellCorpus/Github/rcottrill_Azure/Stop-AllVMs.ps1 | Stop-AllVMs.ps1 |
workflow Stop-ALLVMs
{
param(
[string]$ResourceGroupName,
[string]$TenantID,
[string]$SPuser,
[string]$SPpass
)
$ServicePassword = convertto-securestring $SPpass -asplaintext -force # The password of the Service Principal
$creds = new-object -typenam... |
PowerShellCorpus/Github/moshekaplan_powershell_scripts/all_md5.ps1 | all_md5.ps1 | Param(
[Parameter(Mandatory=$true)][string]$filePath
)
function FileHash([string] $path)
{
#if ($PSVersionTable.PSVersion.Major -ge 4){
# $hash = (Get-FileHash -Algorithm MD5 $path).Hash
#}
#else{
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Hyper-V/lotp_check_hyper-v.ps1 | lotp_check_hyper-v.ps1 | # ====================================================================
# Check Hyper-V VM state
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.3
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign this scrip... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Certificates/lotp_check_certificate.ps1 | lotp_check_certificate.ps1 | # ====================================================================
# Check certificates health state
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign t... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/SQL/check_sqlserver.ps1 | check_sqlserver.ps1 | # ====================================================================
# Check Failover cluster State
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign this... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/AD/lotp_check_ad_accounts.ps1 | lotp_check_ad_accounts.ps1 | # ====================================================================
# Search in AD for lockedout account. To be used through NRPE / nsclient++
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.3
# ====================================================================
#
# Require Set... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/SharePoint/lotp_check_sharepoint.ps1 | lotp_check_sharepoint.ps1 | # ====================================================================
# Check SharePoint 2010/2013 state
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign ... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Hardware/lotp_check_hp_storage.ps1 | lotp_check_hp_storage.ps1 | # ====================================================================
# Check HP storage health state
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign thi... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Network/lotp_check_multiping.ps1 | lotp_check_multiping.ps1 | # ====================================================================
# Ping a list of targets through NRPE / w32tm
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Time/lotp_check_time.ps1 | lotp_check_time.ps1 | # ====================================================================
# Check time against DC or specified server through NRPE / w32tm
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-Execution... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/WSUS/check_windows_updates.ps1 | check_windows_updates.ps1 | ##############################################################################
#
# NAME: check_windows_updates.ps1
#
# AUTHOR: Christian Kaufmann, Umwelt-Campus Birkenfeld
# EMAIL: c.kaufmann@umwelt-campus.de
#
# COMMENT: Script to check for windows updates with Nagios + NRPE/NSClient++
#
# Return Values... |
PowerShellCorpus/Github/mathieuchateau_nsclient-plugins/Files/check_foldersize.ps1 | check_foldersize.ps1 | # ====================================================================
# Check folder size
# Author: Mathieu Chateau - LOTP
# mail: mathieu.chateau@lotp.fr
# version 0.1
# ====================================================================
#
# Require Set-ExecutionPolicy RemoteSigned.. or sign this script wit... |
PowerShellCorpus/Github/cunninghamp_Get-MailboxAuditLoggingReport.ps1/Get-MailboxAuditLoggingReport.ps1 | Get-MailboxAuditLoggingReport.ps1 | <#
.SYNOPSIS
Get-MailboxAuditLoggingReport.ps1 - Generate an Exchange Server mailbox audit logging report
.DESCRIPTION
This PowerShell script will generate a report of the mailbox audit log entries
for a specified mailbox.
.OUTPUTS
Results are output to CSV/HTML, and also optionally to email.
.PARAMETER ... |
PowerShellCorpus/Github/Vis-Rodrigues_AcessosSKY/AcessosSKY/packages/jQuery.1.10.2/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/packages/jQuery.1.10.2/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/packages/jQuery.1.10.2/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/Vis-Rodrigues_AcessosSKY/AcessosSKY/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/OPS-E2E-PPE_E2E_D_Provision_2017_4_29_21_59_13/.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/olafkfreund_AzureAuto/DC1.ps1 | DC1.ps1 | <#
.Synopsis
Deploys new VM DC1 to Azure for O365 Demo.
.DESCRIPTION
.EXAMPLE
.NOTES
#>
Function New-KundenettDeployment{
BEGIN {
Write-Verbose "Verifying Azure account is logged in."
Try{
Get-AzureService -ErrorAction Stop
}#EndTry
... |
PowerShellCorpus/Github/olafkfreund_AzureAuto/Kundenett.ps1 | Kundenett.ps1 | <#
.Synopsis
Deploys new Network to Azure.
.DESCRIPTION
.EXAMPLE
.NOTES
#>
Function New-KundenettDeployment{
BEGIN {
Write-Verbose "Verifying Azure account is logged in."
Try{
Get-AzureService -ErrorAction Stop
}#EndTry
Catch [System... |
PowerShellCorpus/Github/olafkfreund_AzureAuto/Nettverk.ps1 | Nettverk.ps1 | Function New-Network{
[cmdletbinding(SupportsShouldProcess=$true)]
Param (
[Parameter(Mandatory=$True)]
[String]
$rgName,
[Parameter(Mandatory=$True)]
[String]
$saName
)
BEGIN {
Write-Verbose "Verifying Azure account is logged in... |
PowerShellCorpus/Github/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
try {
# Set up variables
$timestamp = (Get-Date).ToString('yyyyMMddHHmmss')
$projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar))
$catalogName = "aspnet-$project... |
PowerShellCorpus/Github/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/SukhdeepSaini_SpendThrift/SpendThriftWebsite/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/jflinden_PowershellAdminScripts/isVirtual.ps1 | isVirtual.ps1 | <#This script parses the BIOS information and makes a best guess if the server is virtual or not
Username and password are passed as a PSCredential to isVirtual.ps1 using readCreds.ps1
e.g. .\readCreds <domain\username> <password> | .\isVirtual <computername>
#>
param (
[string]$Computer_name
... |
PowerShellCorpus/Github/jflinden_PowershellAdminScripts/readCreds.ps1 | readCreds.ps1 | <# This script reads and returns a username and password as a PSCredential object
Based on blog post by msdn user @koteshblog: http://blogs.msdn.com/b/koteshb/archive/2010/02/13/powershell-creating-a-pscredential-object.aspx
username and passowrd are passed as arguments:
ie. readCreds <username> <pass... |
PowerShellCorpus/Github/jflinden_PowershellAdminScripts/Archive-Logs.ps1 | Archive-Logs.ps1 | # Script: Archive-logs.ps1
# Author: James Linden
# Date: 1/21/16
# Comments: .Net 4.5 required; Excerpts taken from Ed Wilson(technet) for CreateZip and GetZipFilesToBeOpened
param($source_dir)
function CreateZip
{ ### This function takes the path to a source directory, and zips the files inside to a
... |
PowerShellCorpus/Github/jflinden_PowershellAdminScripts/CreateLocalUser.ps1 | CreateLocalUser.ps1 |
Function createLocalUser
{
param($User,$pw,$Description)
$computer = get-content env:computername
#Create new local user
$cn =[ADSI]"WinNT://$computer"
$user = $cn.Create("User",$User)
$user.SetPassword($pw)
$user.setinfo()
$user.description = "$Description"
$user.SetInfo()
} |
PowerShellCorpus/Github/kevnord_GitKrakenChocolateyPackage/Source/tools/chocolateyuninstall.ps1 | chocolateyuninstall.ps1 | $ErrorActionPreference = 'Stop'; # stop on all errors
$packageName = 'GitKraken'
$softwareName = 'GitKraken*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique
$installerType = 'EXE'
$silentArgs = '/qn /norestart'
# https://msdn.microsoft.com/en-us/libra... |
PowerShellCorpus/Github/kevnord_GitKrakenChocolateyPackage/Source/tools/chocolateyinstall.ps1 | chocolateyinstall.ps1 | $ErrorActionPreference = 'Stop'; # stop on all errors
$packageName= 'GitKraken' # arbitrary name for the package, used in messages
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://release.gitkraken.com/win32/GitKrakenSetup.exe' # download url
$url64 = 'https:/... |
PowerShellCorpus/Github/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.10.2/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/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.10.2/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/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.10.2/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.9.0/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/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.9.0/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/Lausion_LausionPublic/SklepSportowy/packages/jQuery.1.9.0/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/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/Lausion_LausionPublic/SklepSportowy/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/yi0m0iy_settings/utils/make-bom.ps1 | make-bom.ps1 | Param(
[Parameter(Mandatory=$True,
position=1)]
[string]$Path,
[string[]]$Include,
[string[]]$Exclude,
[switch]$Reverse
)
Push-Location (Split-Path $MyInvocation.MyCommand.Path -parent)
$script = Convert-Path ".\I-LOVE-UTF8-WITHBOM.ps1"
Pop-Location
function Set-Bom {
Param(
[Para... |
PowerShellCorpus/Github/yi0m0iy_settings/utils/I-LOVE-UTF8-WITHBOM.ps1 | I-LOVE-UTF8-WITHBOM.ps1 | #FUCK BOM
Param(
[Parameter(Mandatory=$True,
position=1)]
[string]$Path,
[switch]$reverse,
[switch]$lf
)
if (Test-Path $Path) {
$fileInfo = Get-Item $Path
while ($fileInfo.Target) {
$Path = $fileInfo.Target
$fileInfo = Get-Item $Path
}
if (!$reverse -and !$lf) {
nkf --... |
PowerShellCorpus/Github/yi0m0iy_settings/utils/make-link.ps1 | make-link.ps1 | Param(
[Parameter(Mandatory=$True,
position=1)]
[Alias('source')]
[string]$sourceDir,
[Parameter(Mandatory=$True,
position=2)]
[Alias('link')]
[string]$linkDir,
[string[]]$Include,
[string[]]$Exclude,
[ValidateSet(
"Link",
"File",
"None")]
[string[]]$replace=... |
PowerShellCorpus/Github/yi0m0iy_settings/utils/develop-environment.ps1 | develop-environment.ps1 | Push-Location (Split-Path $MyInvocation.MyCommand.Path -parent)
.\make-link.ps1 "..\WindowsPowerShell\" "$HOME\Documents\WindowsPowerShell\" -Replace File, Link
.\make-bom.ps1 "..\WindowsPowerShell\"
.\make-link.ps1 "..\Keyhac" "$HOME\AppData\Roaming\Keyhac\" -Replace File, Link
.\make-link.ps1 "..\HOME" $HOME -R... |
PowerShellCorpus/Github/yi0m0iy_settings/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 | Microsoft.PowerShell_profile.ps1 | Param(
[Alias("high")]
[switch]$HighFunctionaly,
[switch]$NoProfile
)
#Usage
#LowFuntionaly: powershell
#HighFunctionaly: powershell -noexit -noprofile -command ". $profile -high"
if ($NoProfile) {
$OutputEncoding = [System.Text.Encoding]::ASCII
[Console]::OutputEncoding = [System.Text.Encoding]... |
PowerShellCorpus/Github/dhokenician_hyper-VSwitch/PowerShellSwitch.ps1 | PowerShellSwitch.ps1 | $option=$args[0]
#Requires -RunAsAdministrator
#Write-Host $option
if (-Not ($option -eq "enable" -or $option -eq "disable"))
{
Write-Host "Script requires a parameter. Please pass 'enable' or 'disable'"
Exit
}
# Get the Hyper-V feature and store it in $hyperv
$hyperv = Get-WindowsOptionalFeature -Fe... |
PowerShellCorpus/Github/hujunwei_FMClientTest/packages/Newtonsoft.Json.7.0.1/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://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindo... |
PowerShellCorpus/Github/hujunwei_FMClientTest/packages/Microsoft.Bcl.Build.1.0.14/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne... |
PowerShellCorpus/Github/hujunwei_FMClientTest/packages/Microsoft.Bcl.Build.1.0.14/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
# Normalize project path before calli... |
PowerShellCorpus/Github/hujunwei_FMClientTest/FMtest/packages/Newtonsoft.Json.7.0.1/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://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindo... |
PowerShellCorpus/Github/hujunwei_FMClientTest/FMtest/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/hujunwei_FMClientTest/FMtest/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/hujunwei_FMClientTest/FMtest/packages/Microsoft.Bcl.Build.1.0.14/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne... |
PowerShellCorpus/Github/hujunwei_FMClientTest/FMtest/packages/Microsoft.Bcl.Build.1.0.14/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
# Normalize project path before calli... |
PowerShellCorpus/Github/realflash_html-template-ps/examples/test.ps1 | test.ps1 | Import-Module "c:\inetpub\wwwroot\bin\HTMLTemplate\HTMLTemplate.psm1"
$template = New-HTMLTemplate(@{ filename = 'C:\Users\igibbs.admin\Dropbox\ING-Workspace\ING006 - Transition\VDI\Scripts\report_state\test.tmpl'})
$template.param('FAVOURITE', 'apple')
$template.param('FRUIT', @( @{ NAME = 'Apple'; COLOUR = 'Gr... |
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_NewRepo_2017_4_27_9_17_17/.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/loadimpact_teamcityloadimpact/TeamCity_LoadImpact.ps1 | TeamCity_LoadImpact.ps1 | <#
Copyright 2016 Load Impact
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/Deploy.ps1 | Deploy.ps1 | cd Chocolatey
Remove-Item *.nupkg
cpack
choco push *.nupkg
Read-Host "Press Enter key to continue" |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/PowerShellHere.ps1 | PowerShellHere.ps1 | # OpenHere.ps1
# Write registry keys to add a 'PowerShell Here' option to the Windows Explorer right click menu.
# Create (or overwrite) the key and populate the value to appear in the menu.
$pspath = "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -NoExit"
# for right clicking on folders
Ne... |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/PowerShellHere_Uninstall.ps1 | PowerShellHere_Uninstall.ps1 | # OpenHere.ps1
# Write registry keys to add a 'PowerShell Here' option to the Windows Explorer right click menu.
# Create (or overwrite) the key and populate the value to appear in the menu.
# for right clicking on folders
Remove-Item -Recurse HKLM:\SOFTWARE\Classes\Directory\shell\PSOpenHere -force
#Re... |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/Package.ps1 | Package.ps1 | cd Chocolatey
cpack |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/Chocolatey/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | # OpenHere.ps1
# Write registry keys to add a 'PowerShell Here' option to the Windows Explorer right click menu.
# Create (or overwrite) the key and populate the value to appear in the menu.
$pspath = "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -NoExit"
# for right clicking on folders
Ne... |
PowerShellCorpus/Github/duaneedwards_PowerShellHere/Chocolatey/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | # OpenHere.ps1
# Write registry keys to add a 'PowerShell Here' option to the Windows Explorer right click menu.
# Create (or overwrite) the key and populate the value to appear in the menu.
# for right clicking on folders
Remove-Item -Recurse HKLM:\SOFTWARE\Classes\Directory\shell\PSOpenHere -force
#Re... |
PowerShellCorpus/Github/mgohmann_TCPoshUG/LCMApplyAndMonitor.ps1 | LCMApplyAndMonitor.ps1 | Configuration LCM
{
Node $AllNodes.NodeName
{
LocalConfigurationManager
{
ConfigurationMode = "ApplyAndMonitor"
ConfigurationModeFrequencyMins = 1440
RefreshMode = "Push"
RefreshFrequencyMins = 720
RebootNodeIfNeeded = $false
CertificateId = "ID... |
PowerShellCorpus/Github/mgohmann_TCPoshUG/z_Writing Your Own Resource Part 1.ps1 | z_Writing Your Own Resource Part 1.ps1 |
# The DSC Resource Designer Tool is GREAT!
#Define your properties
$Property = New-xDscResourceProperty -Name "TimeZone" -Attribute Key -Type String -ValidateSet "UTC","Eastern Standard Time","Central Standard Time","Mountain Standard Time","Pacific Standard Time","Alaskan Standard Time","Hawaiian Standard Time... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.