full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/csharris_psake-pester-test/psake/specs/nested/nested2.ps1 | nested2.ps1 | Properties {
$x = 200
}
Task default -Depends Nested2CheckX
Task Nested2CheckX{
Assert ($x -eq 200) '$x was not 200'
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/specs/nested/whatifpreference.ps1 | whatifpreference.ps1 | Task default -Depends WhatIfCheck
Task WhatIfCheck {
Assert ($p1 -eq 'whatifcheck') '$p1 was not whatifcheck'
}
|
PowerShellCorpus/Github/csharris_psake-pester-test/psake/specs/nested/docs.ps1 | docs.ps1 |
Task default -depends Compile,Test
Task Compile -depends CompileSolutionA,CompileSolutionB
Task Test -depends UnitTests,IntegrationTests
Task CompileSolutionA -description 'Compiles solution A' {}
Task CompileSolutionB {}
Task UnitTests -alias 'ut' {}
Task IntegrationTests {}
|
PowerShellCorpus/Github/csharris_psake-pester-test/psake/specs/nested/nested1.ps1 | nested1.ps1 | Properties {
$x = 100
}
Task default -Depends Nested1CheckX
Task Nested1CheckX{
Assert ($x -eq 100) '$x was not 100'
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/specs/nested/always_fail.ps1 | always_fail.ps1 | Task default -Depends AlwaysFail
Task AlwaysFail {
Assert $false "This should always fail."
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/properties.ps1 | properties.ps1 | properties {
$x = $null
$y = $null
$z = $null
}
task default -depends TestProperties
task TestProperties {
Assert ($x -ne $null) "x should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
Assert ($y -ne $null) "y should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
Asser... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/continueonerror.ps1 | continueonerror.ps1 | Task default -Depends TaskA
Task TaskA -Depends TaskB {
"Task - A"
}
Task TaskB -Depends TaskC -ContinueOnError {
"Task - B"
throw "I failed on purpose!"
}
Task TaskC {
"Task - C"
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/parameters.ps1 | parameters.ps1 | properties {
$my_property = $p1 + $p2
}
task default -depends TestParams
task TestParams {
Assert ($my_property -ne $null) "`$my_property should not be null. Run with -parameters @{'p1' = 'v1'; 'p2' = 'v2'}"
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/formattaskname_scriptblock.ps1 | formattaskname_scriptblock.ps1 | properties {
$testMessage = 'Executed Test!'
$compileMessage = 'Executed Compile!'
$cleanMessage = 'Executed Clean!'
}
task default -depends Test
formatTaskName {
param($taskName)
write-host $taskName -foregroundcolor Green
}
task Test -depends Compile, Clean {
$testMessage
}
task Compile -depends Clean ... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/preandpostaction.ps1 | preandpostaction.ps1 | task default -depends Test
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
"Test"
} -PostAction {"Post-Test"}
task Compile -depends Clean {
"Compile"
}
task Clean {
"Clean"
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/preandpostcondition.ps1 | preandpostcondition.ps1 | properties {
$runTaskA = $false
$taskBSucceded = $true
}
task default -depends TaskC
task TaskA -precondition { $runTaskA -eq $true } {
"TaskA executed"
}
task TaskB -postcondition { $taskBSucceded -eq $true } {
"TaskB executed"
}
task TaskC -depends TaskA,TaskB {
"TaskC executed."
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/checkvariables.ps1 | checkvariables.ps1 | Properties {
$x = 1
$y = 2
}
FormatTaskName "[{0}]"
Task default -Depends Verify
Task Verify -Description "This task verifies psake's variables" {
Assert (Test-Path 'variable:\psake') "psake variable was not exported from module"
Assert ($psake.ContainsKey("version")) "psake variable does not contain 'v... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/msbuild40.ps1 | msbuild40.ps1 | Framework "4.0"
# Framework "4.0x64"
task default -depends ShowMsBuildVersion
task ShowMsBuildVersion {
msbuild /version
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/tasksetupandteardown.ps1 | tasksetupandteardown.ps1 | TaskSetup {
"Executing task setup"
}
TaskTearDown {
"Executing task tear down"
}
Task default -depends TaskB
Task TaskA {
"TaskA executed"
}
Task TaskB -depends TaskA {
"TaskB executed"
}
|
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/default.ps1 | default.ps1 | properties {
$testMessage = 'Executed Test!'
$compileMessage = 'Executed Compile!'
$cleanMessage = 'Executed Clean!'
}
task default -depends Test
task Test -depends Compile, Clean {
$testMessage
}
task Compile -depends Clean {
$compileMessage
}
task Clean {
$cleanMessage
}
task ? -Description "Helpe... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/paralleltasks.ps1 | paralleltasks.ps1 | Task ParallelTask1 {
"ParallelTask1"
}
Task ParallelTask2 {
"ParallelTask2"
}
Task ParallelNested1andNested2 {
$jobArray = @()
@("ParallelTask1", "ParallelTask2") | ForEach-Object {
$jobArray += Start-Job {
param($scriptFile, $taskName)
Invoke-psake $s... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/requiredvariables.ps1 | requiredvariables.ps1 | properties {
$x = $null
$y = $null
$z = $null
}
task default -depends TestRequiredVariables
# you can put arguments to task in multiple lines using `
task TestRequiredVariables `
-description "This task shows how to make a variable required to run task. Run this script with -properties @{x = 1; y = ... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/formattaskname_string.ps1 | formattaskname_string.ps1 | properties {
$testMessage = 'Executed Test!'
$compileMessage = 'Executed Compile!'
$cleanMessage = 'Executed Clean!'
}
task default -depends Test
formatTaskName "-------{0}-------"
task Test -depends Compile, Clean {
$testMessage
}
task Compile -depends Clean {
$compileMessage
}
task Clean {
$cleanM... |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/nested.ps1 | nested.ps1 | Properties {
$x = 1
}
Task default -Depends RunNested1, RunNested2, CheckX
Task RunNested1 {
Invoke-psake .\nested\nested1.ps1
}
Task RunNested2 {
Invoke-psake .\nested\nested2.ps1
}
Task CheckX{
Assert ($x -eq 1) '$x was not 1'
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/nested/nested2.ps1 | nested2.ps1 | Properties {
$x = 200
}
Task default -Depends Nested2CheckX
Task Nested2CheckX{
Assert ($x -eq 200) '$x was not 200'
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/nested/nested1.ps1 | nested1.ps1 | Properties {
$x = 100
}
Task default -Depends Nested1CheckX
Task Nested1CheckX{
Assert ($x -eq 100) '$x was not 100'
} |
PowerShellCorpus/Github/csharris_psake-pester-test/psake/examples/passingParametersString/parameters.ps1 | parameters.ps1 | properties {
$buildOutputPath = ".\bin\$buildConfiguration"
}
task default -depends DoRelease
task DoRelease {
Assert ("$buildConfiguration" -ne $null) "buildConfiguration should not have been null"
Assert ("$buildConfiguration" -eq 'Release') "buildConfiguration=[$buildConfiguration] should have been 'Rel... |
PowerShellCorpus/Github/ddoyle98321_PS_Accounting_Barcode_RemoteInstall/RunPSScript.ps1 | RunPSScript.ps1 |
# This is the file that contains the list of computers you want
# to copy the folder and files to. Change this path IAW your folder structure.
$computers = gc "C:\Temp\computers.txt"
# This is the directory you want to copy to the computer (IE. c:\folder_to_be_copied)
$source = "c:\Temp\Font Install\Add-Font2... |
PowerShellCorpus/Github/ddoyle98321_PS_Accounting_Barcode_RemoteInstall/CopyFonts.ps1 | CopyFonts.ps1 |
# This is the file that contains the list of computers you want
# to copy the folder and files to. Change this path IAW your folder structure.
$computers = gc "C:\Temp\computers.txt"
# This is the directory you want to copy to the computer (IE. c:\folder_to_be_copied)
$source = "\\dta01094p07\MSS\Private\MISC... |
PowerShellCorpus/Github/ddoyle98321_PS_Accounting_Barcode_RemoteInstall/Add-Font2.ps1 | Add-Font2.ps1 | #########################################################################################
# MICROSOFT LEGAL STATEMENT FOR SAMPLE SCRIPTS/CODE
#########################################################################################
# This Sample Code is provided for the purpose of illustration only and is not
... |
PowerShellCorpus/Github/SAPIENTechnologiesInc_PowerShell-Scripts/Set-WMIExplorerPermissions.ps1 | Set-WMIExplorerPermissions.ps1 | <#
.SYNOPSIS
Sets permissions required to access WMI classes on a remote computer running Windows 8.
.DESCRIPTION
Set-WmiExplorerPermissions.ps1 gives the current user the permissions required to access
WMI classes on a remote computer that is running Windows 8. These permissions are required
to use SAPIEN Tec... |
PowerShellCorpus/Github/mnelkholy_K2-PowerShell/Force Identity Cache Group Refresh.ps1 | Force Identity Cache Group Refresh.ps1 | # Make sure account running has impersonate rights on the K2 server and also database permissions to the K2 database.
# SQL queries are for default database name of K2
$k2server = "localhost"
$k2serverport = 5555
$sqlConnectionString = "Server=dlx;Database=K2;Integrated Security=True"
Write-Host "Expiring I... |
PowerShellCorpus/Github/anthonygtellez_Splunk_delete_fishbucket/fw_delete_fishbucket_windows/bin/remove_fishbucket..ps1 | remove_fishbucket..ps1 | # Windows PowerShell check 'If File Exists'
$ChkFile = "C:\Program Files\SplunkUniversalForwarder\.fishbucket"
$FileExists = Test-Path $ChkFile
If ($FileExists -eq $True)
Exit
Else
fsutil createNew "C:\Program Files\SplunkUniversalForwarder\.fishbucket" 1000
NET STOP SplunkForwarder
@RD /S /Q "C:\Program File... |
PowerShellCorpus/Github/rcook_powershell-config/Microsoft.PowerShell_profile.ps1 | Microsoft.PowerShell_profile.ps1 | Import-Module (Resolve-Path $HOME\Documents\WindowsPowerShell\Profile.psm1)
|
PowerShellCorpus/Github/haidong_mssqlps/generateDBCCScripts.ps1 | generateDBCCScripts.ps1 | param([parameter(Mandatory=$true)]$ServerInstance)
. "X:\pathTo\baseFunctions.ps1"
try {
$results = Invoke-Sqlcmd -Query "select @@servername" -ServerInstance $ServerInstance
}
catch {
"Check your spelling. You might have put in the wrong instance name or it is down: $ServerInstance"
exit
}
$serverName = $resu... |
PowerShellCorpus/Github/haidong_mssqlps/GetAndStoreInstanceMetadata.ps1 | GetAndStoreInstanceMetadata.ps1 | param([parameter(Mandatory=$true)]$ServerInstance)
import-module sqlps
Function getAndStoreInstanceMetadata($ServerInstance)
{
try {
$results = Invoke-Sqlcmd -Query "select @@servername" -SuppressProviderContextWarning -ServerInstance $ServerInstance
}
catch {
"Check your spelling. You might have put in the wro... |
PowerShellCorpus/Github/haidong_mssqlps/baseFunctions.ps1 | baseFunctions.ps1 | #Base Functions for SQL Server administration
#Due to errors with AD that I don't quite understand yet, Get-ADUser can spit
#out ADIdentityNotFoundException. Setting $ErrorActionPreference to
#"SilentlyContinue" solved it.
$ErrorActionPreference = "SilentlyContinue"
Import-Module sqlps -DisableNameChecking
Impo... |
PowerShellCorpus/Github/haidong_mssqlps/generateAttachScripts.ps1 | generateAttachScripts.ps1 | param([parameter(Mandatory=$true)]$ServerInstance)
. "X:\pathTo\baseFunctions.ps1"
try {
$results = Invoke-Sqlcmd -Query "select @@servername" -ServerInstance $ServerInstance
}
catch {
"Check your spelling. You might have put in the wrong instance name or it is down: $ServerInstance"
exit
}
$serverName = $resu... |
PowerShellCorpus/Github/haidong_mssqlps/generateSQLScriptsForUpgrade.ps1 | generateSQLScriptsForUpgrade.ps1 | param([parameter(Mandatory=$true)]$ServerInstance)
# *** Note: modify the line below so we can souce in baseFunctions.ps1
. "C:\Users\alex\Documents\GitHub\mssqlps\baseFunctions.ps1"
try {
$results = Invoke-Sqlcmd -Query "select @@servername" -ServerInstance $ServerInstance
}
catch {
"Check your spelling. You mi... |
PowerShellCorpus/Github/haidong_mssqlps/getHostDiskInfo.ps1 | getHostDiskInfo.ps1 | #ADD-PSSNAPIN SqlServerProviderSnapin100
#ADD-PSSNAPIN SqlServerCmdletSnapin100
$a = Invoke-Sqlcmd -Query "exec metrics.SelectHostSID_Name_WMIError" -ServerInstance "monitoringServer" -Database "Dbametrics"
$a | ForEach-Object {
$hostName = $_.hostname
$hostSID = $_.hostSID
if ($_.WMIError.ToUpper() -... |
PowerShellCorpus/Github/haidong_mssqlps/generateDetachScripts.ps1 | generateDetachScripts.ps1 | param([parameter(Mandatory=$true)]$ServerInstance)
. "X:\pathTo\baseFunctions.ps1"
try {
$results = Invoke-Sqlcmd -Query "select @@servername" -ServerInstance $ServerInstance
}
catch {
"Check your spelling. You might have put in the wrong instance name or it is down: $ServerInstance"
exit
}
$serverName = $resu... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertInstanceConfig.ps1 | insertInstanceConfig.ps1 | function getInstanceConfig($ServerInstance) {
$InstanceConfigQuery = @"
SELECT [configuration_id]
, [name]
, [value]
, [value_in_use]
FROM [sys].[configurations];
"@
try {
$InstanceConfigList = Invoke-Sqlcmd -ServerInstance $ServerI... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/updateHost.ps1 | updateHost.ps1 | function updateHostSQL($h) {
$HostName = $h.HostName
$HostID = $h.HostID
try {
$WmiResults = get-wmiobject -computername $HostName -Class Win32_ComputerSystem
$BiosResults = get-wmiobject -computername $HostName -Class Win32_BIOS
}
catch [Exception] {
continue
... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/updateInstance.ps1 | updateInstance.ps1 | function updateInstanceSQL($i) {
$InstanceName = $i.InstanceName
$InstanceID = $i.InstanceID
$result = Invoke-Sqlcmd -ServerInstance $InstanceName -Query "SELECT SERVERPROPERTY('Edition')"
$InstanceEdition = $result.column1
$result = Invoke-Sqlcmd -ServerInstance $InstanceName -Query "SELECT... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertInstance.ps1 | insertInstance.ps1 | function getSqlInstanceName($ComputerName) {
$SqlInstances = Get-Service -ComputerName $ComputerName | where {($_.Name -like
'mssql$*') -or ($_.Name -eq 'mssqlserver')}
$instanceArray = @()
if ($SqlInstances -ne $null) {
$SqlInstances | foreach {
$sqlName = $_.Name
$service = Get-Wm... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertDbFileStats.ps1 | insertDbFileStats.ps1 | function getInstanceUserDb($ServerInstance)
{
$UserDbList = Invoke-Sqlcmd -ServerInstance $ServerInstance -Query "select name
from master.sys.databases where name not in ('master', 'model', 'msdb',
'tempdb') and state_desc = 'online'"
$UserDbList
}
function getDbFileInfo($ServerIn... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertStorage.ps1 | insertStorage.ps1 | $HostList = Invoke-Sqlcmd -Query "EXEC Windows.Host_Select_HostID_HostName" -ServerInstance "sql1" -Database "JiMetrics"
$HostList | ForEach-Object {
$HostName = $_.HostName
$HostID = $_.HostID
#Note: DriveType 5 is CD/DVD, DriveType 2 is removable disk therefore we don't care. We only care about LocalDisk,... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertInstanceDmvPerfCounter.ps1 | insertInstanceDmvPerfCounter.ps1 | function getInstanceDmvPerfCounter($ServerInstance)
{
$InstanceDmvPerfCounterQuery = @"
select object_name
, counter_name
, instance_name
, cntr_value
, cntr_type
from sys.dm_os_performance_counters
where [counter_name] IN ( N'Page life expectancy'
, N... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/insertTableStats.ps1 | insertTableStats.ps1 | function getInstanceUserDb($ServerInstance)
{
$UserDbList = Invoke-Sqlcmd -ServerInstance $ServerInstance -Query "select name
from master.sys.databases where name not in ('master', 'model', 'msdb',
'tempdb') and state_desc = 'online'"
$UserDbList
}
function getDbDataIndexSizeInMB($ServerInstance,... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/insertInstanceConfigSQL.Tests.ps1 | insertInstanceConfigSQL.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "getInstanceConfig" {
It "retrieves current SQL Server instance configuration values" {
$config = getInstanceConfig("sql1")
$config[0].Configurati... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/insertInstanceSQL.Tests.ps1 | insertInstanceSQL.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "getSqlInstanceName" {
It "sql2 has Finance and HR" {
$SqlInstances = getSqlInstanceName("sql2")
$SqlInstances[1].InstanceName | Should Be "sql2\... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/updateInstanceSQL.ps1 | updateInstanceSQL.ps1 | function updateInstanceSQL($i) {
$InstanceName = $i.InstanceName
$InstanceID = $i.InstanceID
$result = Invoke-Sqlcmd -ServerInstance $InstanceName -Query "SELECT SERVERPROPERTY('Edition')"
$InstanceEdition = $result.column1
$result = Invoke-Sqlcmd -ServerInstance $InstanceName -Query "SELECT... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/updateHostSQL.Tests.ps1 | updateHostSQL.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "updateHostSQL" {
It "should produce proper update host stored procedure call" {
$hh = @{HostID = 1; HostName = "sql1"}
$sql = updateHostSQL($hh)
... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/insertInstanceSQL.ps1 | insertInstanceSQL.ps1 | function getSqlInstanceName($ComputerName) {
$SqlInstances = Get-Service -ComputerName $ComputerName | where {($_.Name -like
'mssql$*') -or ($_.Name -eq 'mssqlserver')}
$instanceArray = @()
if ($SqlInstances -ne $null) {
$SqlInstances | foreach {
$sqlName = $_.Name
$service = Get-Wm... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/insertInstanceConfigSQL.ps1 | insertInstanceConfigSQL.ps1 | function getInstanceConfig($ServerInstance) {
$InstanceConfigQuery = @"
SELECT [configuration_id]
, [name]
, [value]
, [value_in_use]
FROM [sys].[configurations];
"@
try {
$InstanceConfigList = Invoke-Sqlcmd -ServerInstance $ServerI... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/updateInstanceSQL.Tests.ps1 | updateInstanceSQL.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "updateInstanceSQL" {
It "generate the right SQL for sql1" {
$sql = updateInstanceSQL @{InstanceName = "sql1"; InstanceID = 1}
$sql | Should Be "E... |
PowerShellCorpus/Github/haidong_mssqlps/JiMetrics/dev/updateHostSQL.ps1 | updateHostSQL.ps1 | function updateHostSQL($h) {
$HostName = $h.HostName
$HostID = $h.HostID
try {
$WmiResults = get-wmiobject -computername $HostName -Class Win32_ComputerSystem
$BiosResults = get-wmiobject -computername $HostName -Class Win32_BIOS
}
catch [Exception] {
continue
... |
PowerShellCorpus/Github/haidong_mssqlps/Dev/baseFunctions.ps1 | baseFunctions.ps1 | #Base Functions for SQL Server administration
#Due to errors with AD that I don't quite understand yet, Get-ADUser can spit
#out ADIdentityNotFoundException. Setting $ErrorActionPreference to
#"SilentlyContinue" solved it.
$ErrorActionPreference = "SilentlyContinue"
Import-Module sqlps -DisableNameChecking
Impo... |
PowerShellCorpus/Github/haidong_mssqlps/Dev/Copy-MasterSPs.ps1 | Copy-MasterSPs.ps1 | param([parameter(Mandatory=$true)]$SourceInstance, [parameter(Mandatory=$true)]$DestinationInstance)
. .\baseFunctions.ps1
$spLists = getInstanceMasterUserSP($SourceInstance)
$spLists.name | foreach {
$sp = $_
$query = "IF OBJECT_ID('dbo.$sp', 'P') IS NOT NULL DROP PROC dbo.$sp"
Invoke-Sqlcmd -ServerInst... |
PowerShellCorpus/Github/haidong_mssqlps/Dev/baseFunctions.Tests.ps1 | baseFunctions.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "getInstanceMasterUserSP" {
It "should have sp_WhoIsActive" {
$a = getInstanceMasterUserSP("sql1")
$a.name[1] | Should Be "sp_WhoIsActi... |
PowerShellCorpus/Github/sameerinfodb_XHackers/Housee/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/sameerinfodb_XHackers/Housee/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/sameerinfodb_XHackers/Housee/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/SDGoodwin_AD-PW-Notification/pwnotification.ps1 | pwnotification.ps1 | ##################################################################################################################
# Please Configure the following variables....
$smtpServer="Company Email Server"
$expireindays = 14
$from = "Email address you want reminders to come from"
###########################################... |
PowerShellCorpus/Github/cjander18_Continuous-Integration-Scripted/Main.ps1 | Main.ps1 | Function Deploy-Files {
param(
# One or more directories, that are processed in order, listing directories from which to check for files
[string[]] $Directory = "",
# One or more files, that are processed in order, that specify the directories from which to check for files
[string[]] $Direc... |
PowerShellCorpus/Github/cjander18_Continuous-Integration-Scripted/Config/Config.ps1 | Config.ps1 | $ServerName = ""
$DatabaseName = ""
$SQLUser = ""
$SQLPassword = ""
$TargetDirectory = "C:\Users\Rumor\OneDrive\Code\SQL\StoredProcedures"
try
{
# Build a Database object to make queries and calls more concise and modular
$DbObj = New-Object -TypeName PSCustomObject -Property ([Ordered] @{
... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_25_22_41_39/.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/matswarnolf_smokie/New-SGOFBMigration.ps1 | New-SGOFBMigration.ps1 | <#
AXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANSAXIANS
+----------------------------------------------------------------------------+
| File : New-SGOFBMigration.ps1
| Author : Mats.Warnolf@axians.se ... |
PowerShellCorpus/Github/Budzyn_BSA-ORM/MyEntity/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/Budzyn_BSA-ORM/MyEntity/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/Budzyn_BSA-ORM/MyEntity2/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/Budzyn_BSA-ORM/MyEntity2/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/iwantolearn_meonpowershell/Sync-Folders.ps1 | Sync-Folders.ps1 | function sync-folders
{
Param( [Parameter(ValueFromPipeline=$true, Mandatory=$true)][string]$src,
[Parameter(ValueFromPipeline=$true, Mandatory=$true)][string]$dest
)
Begin {
#color-legend
$color = {
""
"------------"
"Color Legend"
"------------"
"Creation/Copy/Touch"
"--"
write-host "dark... |
PowerShellCorpus/Github/iwantolearn_meonpowershell/Show-BalloonNotification.ps1 | Show-BalloonNotification.ps1 | Function Show-BalloonNotification {
param (
[Parameter(Mandatory=$true)][string]$Message,
[string]$Title,
[ValidateSet("None", "Info", "Warning", "Error")][string]$Icon,
[int]$Duration=10000
)
Begin {
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$Notify = New-Object Sy... |
PowerShellCorpus/Github/iwantolearn_meonpowershell/Start-MyPlaylists.ps1 | Start-MyPlaylists.ps1 | begin
{
# Plays my playlists on wmplayer - i'll add being able to choose playlists later, atm it will play ALL pl's on the playlist folder generated when you create a pl from wmplayer
# timer thing whilst playing using timespan and stopwatch
# references I used for this project are below
## http://blogs.technet.co... |
PowerShellCorpus/Github/kedonov_VPRepoTesting_hy-AM/.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/OPSTest_E2E_Provision_1490061665519/.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/johlju_Samples/Get-Something/Get-Something.ps1 | Get-Something.ps1 | function Get-Something
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=0)]
[ValidateNotNullOrEmpty()]
[string]$Title
)
Write-Verbose $Title
}
Get-Something -Title "Söder Ögon Åder Råd Rädd" -Verbose
#Get-Something -Title "Än... |
PowerShellCorpus/Github/johlju_Samples/Write-SQLPSStubFile/Write-ModuleStubFile.ps1 | Write-ModuleStubFile.ps1 | function Write-ModuleStubFile {
param
(
[Parameter( Mandatory )]
[System.String] $ModuleName,
[Parameter( Mandatory )]
[System.String] $StubPath
)
Import-Module $ModuleName -DisableNameChecking -Force
( ( get-command -Module $ModuleName -CommandType ... |
PowerShellCorpus/Github/johlju_Samples/Tests/Dummy.Tests.ps1 | Dummy.Tests.ps1 | $script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'xSQLServerAvailabilityGroupListener'
#region HEADER
# Unit Test Template Version: 1.1.0
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -Ch... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485079544707/.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/OPS-E2E-PPE_E2E_D_Provision_2017_4_19_9_11_46/.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/HatidzaS_Test/FFCAplication/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/HatidzaS_Test/FFCAplication/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/HatidzaS_Test/FFCAplication/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/HatidzaS_Test/FFCAplication/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/OPSTest_E2E_Provision_1485320739734/.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/VereTech_Scripts/Template.ps1 | Template.ps1 | <#
.SYNOPSIS
Describe the function here
.DESCRIPTION
Describe the function in more detail
.OUTPUT
Describe the error levels and verboseness? <is that a word?> of the script
.EXAMPLE
Give an example of how to use it
.EXAMPLE
Give another example of how to use it
.PARAMETER -paramn... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Local Account/GetLocalAccountsList.ps1 | GetLocalAccountsList.ps1 | <#
.SYNOPSIS
Report a list of local user accounts
.DESCRIPTION
Use by itself to obtain a list of the localhost
.EXAMPLE
Get-LocalAccountList
#>
$ExitCode = "0"
$users = ""
$users = get-wmiobject win32_useraccount –computername $computer
if (!($users)) {
Write-Host "Unable to obta... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Local Account/ResetLocalAccountPassword.ps1 | ResetLocalAccountPassword.ps1 | <#
.SYNOPSIS
Describe the function here
.DESCRIPTION
Describe the function in more detail
.OUTPUT
Describe the error levels and verboseness? <is that a word?> of the script
.EXAMPLE
Give an example of how to use it
.EXAMPLE
Give another example of how to use it
.PARAMETER -paramn... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Disk Health/CHKDSK.ps1 | CHKDSK.ps1 | <#
.SYNOPSIS
Runs CHKDSK on all volumes
.DESCRIPTION
Can be used by itself or specify the drives by passing parameters.
.EXAMPLE
Specify to chkdsk 1 drive
chkdsk.ps1 -Drives C:
.EXAMPLE
Specify to defrag multiple drives
chkdsk.ps1 -Drives C:,D:,E:
.PARAMETER
-Drives
Optional
... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Disk Health/defragment.ps1 | defragment.ps1 | <#
.SYNOPSIS
Defrags all Volumes available
.DESCRIPTION
Can be used by itself or specify the drives by passing parameters.
.EXAMPLE
Specify to defrag 1 drive
Defrag.ps1 -Drives C:
.EXAMPLE
Specify to defrag multiple drives
Defrag.ps1 -Drives C:,D:,E:
.PARAMETER
-Drives
Optional
... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/FixIT/empty-print-spool.ps1 | empty-print-spool.ps1 |
function _restart_service()
{
$comp = gc env:computername
$SrvName = "Spooler"
try {
stop-service -Name Spooler -Force
Start-Sleep 5
start-service -Name Spooler
Write-Host "Spooler Service Resarted"
Exit 0
}
catch
{
Write-Host "Something went wrong restarting Print Spooler service"
Exit 1001
}
... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Software Installation/deploy-adobe-from-url.ps1 | deploy-adobe-from-url.ps1 | <#
.SYNOPSIS
Download and install software from a URL depending on OS version and archetecture.
.DESCRIPTION
This script can be launched with no parameters, however you can customise it by
passing parameters to it, see the PARAMETERS section for details
#>
#
# Parameters
#
param (
[string]$Com... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Software Installation/deploy-url-os-specific.ps1 | deploy-url-os-specific.ps1 | <#
.SYNOPSIS
Download and install software from a URL depending on OS version and archetecture.
.DESCRIPTION
This script can be launched with no parameters, however you can customise it by
passing parameters to it, see the PARAMETERS section for details
#>
#
# Parameters
#
param (
[string]$Com... |
PowerShellCorpus/Github/VereTech_Scripts/Tasks/Windows/Run Once Setup/brand-system-properties.ps1 | brand-system-properties.ps1 | <#
.SYNOPSIS
This changes the system properties to include information about the service provider
.DESCRIPTION
This script can be launched with no parameters, however you can customise it by
passing parameters to it, see the PARAMETERS section for details
#>
#
# Parameters
#
param (
[String]... |
PowerShellCorpus/Github/VereTech_Scripts/Checks/Windows/Is-Adobe-Acrobat-Reader-Installed.ps1 | Is-Adobe-Acrobat-Reader-Installed.ps1 | <#
.SYNOPSIS
Script Check, if adobe reader is installed PASS, if not FAIL
#>
<#
.SYNOPSIS
Search for installed Applications where the application name is "like" the passed parameter.
This uses the registry to conduct its search instead of WMIC.
.DESCRIPTION
Set registry search folders... |
PowerShellCorpus/Github/VereTech_Scripts/Checks/Windows/PatchSettings.ps1 | PatchSettings.ps1 | # Send something to STDOUT to prevent task_start.js to lock if the script fails
Write-Host " "
## SETUP ENVIRONMENT
# Find "Advanced Monitoring Agent" service and use path to locate files
$gfimaxagent = Get-WmiObject Win32_Service | Where-Object { $_.Name -eq 'Advanced Monitoring Agent' }
$gfimaxexe = $gfimaxag... |
PowerShellCorpus/Github/VereTech_Scripts/Checks/Windows/read-recovery.ps1 | read-recovery.ps1 | # List of settings that indicate the action to be taken by a computer
# Runs on Windows 7,8 workstations
Try {
$RecoveryConf = get-wmiobject "Win32_OSRecoveryConfiguration"
foreach ($RCItem in $RecoveryConf) {
switch ($RCItem.DebugInfoType) {
0{$DebugInfoType= "None"}
... |
PowerShellCorpus/Github/VereTech_Scripts/Checks/Windows/Install-ApplicationsFromMAXfocus.ps1 | Install-ApplicationsFromMAXfocus.ps1 | <#
.Synopsis
Installs software silently on servers and workstations using Chocolatey.
.DESCRIPTION
The script is to be uploaded to your dashboard account as a user script.
It can run both as a script check and as a scheduled task. You list package
names as parameter to script. Chocolatey will update ... |
PowerShellCorpus/Github/digipost_appveyor-deploy/NugetRestore.ps1 | NugetRestore.ps1 | . $PSScriptRoot\Common.ps1
Print-Step-Header "before_build: Restoring NuGet dependencies"
nuget restore |
PowerShellCorpus/Github/digipost_appveyor-deploy/TestPreamble.ps1 | TestPreamble.ps1 | . $PSScriptRoot\Common.ps1
Print-Step-Header "test: Running tests in solution if any" |
PowerShellCorpus/Github/digipost_appveyor-deploy/MoveSigningKey.ps1 | MoveSigningKey.ps1 | Param(
[string]$signingKeyPath,
[string]$signingKeyDestination
)
$signingKeyExists = (Test-Path $signingKeyPath)
if(!$signingKeyExists)
{
throw "Could not find signing key at $signingKeyPath. Please check that this is the decryption path for the signing key."
}
Write-Host "Moving signing key from... |
PowerShellCorpus/Github/digipost_appveyor-deploy/AssemblyInfoVersionPatcher.ps1 | AssemblyInfoVersionPatcher.ps1 | Param(
[string]$assemblyInfoPath
)
. $PSScriptRoot\Common.ps1
$assemblyInfoName = (Get-Item $assemblyInfoPath).Name
Print-Step-Header "before_build: Patching version in $assemblyInfoName"
$globalAssemblyFileContent = Get-Content $assemblyInfoPath
$versionMatchPattern = '[0-9]+(\.([0-9]+|\*)){1... |
PowerShellCorpus/Github/digipost_appveyor-deploy/BuildPreamble.ps1 | BuildPreamble.ps1 | . $PSScriptRoot\Common.ps1
Print-Step-Header "build: Building library"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.