full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Coverage.ps1 | Coverage.ps1 | if ($PSVersionTable.PSVersion.Major -le 2)
{
function Exit-CoverageAnalysis { }
function Get-CoverageReport { }
function Show-CoverageReport { }
function Enter-CoverageAnalysis {
param ( $CodeCoverage )
if ($CodeCoverage) { Write-Error 'Code coverage analysis requires PowerShell... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/New-Fixture.Tests.ps1 | New-Fixture.Tests.ps1 | Set-StrictMode -Version Latest
Describe "New-Fixture" {
It "Name parameter is mandatory:" {
(get-command New-Fixture ).Parameters.Name.ParameterSets.__AllParameterSets.IsMandatory | Should Be $true
}
Context "Only Name parameter is specified:" {
It "Creates fixture in current direc... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Describe.Tests.ps1 | Describe.Tests.ps1 | Set-StrictMode -Version Latest
Describe 'Testing Describe' {
It 'Has a non-mandatory fixture parameter which throws the proper error message if missing' {
$command = Get-Command Describe -Module Pester
$command | Should Not Be $null
$parameter = $command.Parameters['Fixture']
... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Context.Tests.ps1 | Context.Tests.ps1 | Set-StrictMode -Version Latest
Describe 'Testing Context' {
It 'Has a non-mandatory fixture parameter which throws the proper error message if missing' {
$command = Get-Command Context -Module Pester
$command | Should Not Be $null
$parameter = $command.Parameters['Fixture']
... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/TestResults.Tests.ps1 | TestResults.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Write nunit test results (Legacy)" {
Setup -Dir "Results"
It "should write a successful test result" {
#create state
$TestResults = New-PesterState -Path TestDrive:\
$testResults.EnterDescr... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/PesterState.ps1 | PesterState.ps1 | function New-PesterState
{
param (
[String[]]$TagFilter,
[String[]]$ExcludeTagFilter,
[String[]]$TestNameFilter,
[System.Management.Automation.SessionState]$SessionState,
[Switch]$Strict,
[Switch]$Quiet
)
if ($null -eq $SessionState) { $SessionStat... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/PesterState.Tests.ps1 | PesterState.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "New-PesterState" {
Context "TestNameFilter parameter is set" {
$p = new-pesterstate -TestNameFilter "filter"
it "sets the TestNameFilter property" {
$p.TestNameFilter | should be "filter"
... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Context.ps1 | Context.ps1 | function Context {
<#
.SYNOPSIS
Provides logical grouping of It blocks within a single Describe block. Any Mocks defined
inside a Context are removed at the end of the Context scope, as are any files or folders
added to the TestDrive during the Context block's execution. Any BeforeEach or AfterEach
blocks defined... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Mock.Tests.ps1 | Mock.Tests.ps1 | Set-StrictMode -Version Latest
function FunctionUnderTest
{
[CmdletBinding()]
param (
[Parameter(Mandatory=$false)]
[string]
$param1
)
return "I am a real world test"
}
function FunctionUnderTestWithoutParams([string]$param1) {
return "I am a real world test... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Coverage.Tests.ps1 | Coverage.Tests.ps1 | if ($PSVersionTable.PSVersion.Major -le 2) { return }
InModuleScope Pester {
Describe 'Code Coverage Analysis' {
$root = (Get-PSDrive TestDrive).Root
$null = New-Item -Path $root\TestScript.ps1 -ItemType File -ErrorAction SilentlyContinue
Set-Content -Path $root\TestScript.ps1 -Va... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/It.ps1 | It.ps1 | function It {
<#
.SYNOPSIS
Validates the results of a test inside of a Describe block.
.DESCRIPTION
The It command is intended to be used inside of a Describe or Context Block.
If you are familiar with the AAA pattern (Arrange-Act-Assert), the body of
the It block is the appropriate location for an assert. The... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/In.ps1 | In.ps1 | function In {
<#
.SYNOPSIS
A convenience function that executes a scrit from a specified path.
.DESCRIPTION
Before the script block passed to the execute parameter is invoked,
the current location is set to the path specified. Once the script
block has been executed, the location will be reset to the location
... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/SetupTeardown.Tests.ps1 | SetupTeardown.Tests.ps1 | Describe 'Describe-Scoped Test Case setup' {
BeforeEach {
$testVariable = 'From BeforeEach'
}
$testVariable = 'Set in Describe'
It 'Assigns the correct value in first test' {
$testVariable | Should Be 'From BeforeEach'
$testVariable = 'Set in It'
}
It 'Assi... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/InModuleScope.ps1 | InModuleScope.ps1 | function InModuleScope
{
<#
.SYNOPSIS
Allows you to execute parts of a test script within the
scope of a PowerShell script module.
.DESCRIPTION
By injecting some test code into the scope of a PowerShell
script module, you can use non-exported functions, aliases
and variables inside that module, ... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Mock.ps1 | Mock.ps1 | function Mock {
<#
.SYNOPSIS
Mocks the behavior of an existing command with an alternate
implementation.
.DESCRIPTION
This creates new behavior for any existing command within the scope of a
Describe or Context block. The function allows you to specify a script block
that will become the command's new behav... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Describe.ps1 | Describe.ps1 | function Describe {
<#
.SYNOPSIS
Creates a logical group of tests. All Mocks and TestDrive contents
defined within a Describe block are scoped to that Describe; they
will no longer be present when the Describe block exits. A Describe
block may contain any number of Context and It blocks.
.PARAMETER Name
The... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Match.ps1 | Match.ps1 |
function PesterMatch($value, $expectedMatch) {
return ($value -match $expectedMatch)
}
function PesterMatchFailureMessage($value, $expectedMatch) {
return "Expected: {$value} to match the expression {$expectedMatch}"
}
function NotPesterMatchFailureMessage($value, $expectedMatch) {
return "Expe... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/MatchExactly.Tests.ps1 | MatchExactly.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "MatchExactly" {
It "returns true for things that match exactly" {
PesterMatchExactly "foobar" "ob" | Should Be $true
}
It "returns false for things that do not match exactly" {
PesterMatchExact... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/PesterThrow.Tests.ps1 | PesterThrow.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterThrow" {
It "returns true if the statement throws an exception" {
Test-PositiveAssertion (PesterThrow { throw })
}
It "returns false if the statement does not throw an exception" {
Test-N... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeNullOrEmpty.ps1 | BeNullOrEmpty.ps1 |
function PesterBeNullOrEmpty($value) {
if ($null -eq $value) {
return $true
}
if ([String] -eq $value.GetType()) {
return [String]::IsNullOrEmpty($value)
}
if ($null -ne $value.PSObject.Properties['Count'] -and
$null -ne $value.Count) {
return $value.Count ... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Should.Tests.ps1 | Should.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Parse-ShouldArgs" {
It "sanitizes assertions functions" {
$parsedArgs = Parse-ShouldArgs TestFunction
$parsedArgs.AssertionMethod | Should Be PesterTestFunction
}
It "works with strict mode whe... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Exist.ps1 | Exist.ps1 |
function PesterExist($value) {
return (Test-Path $value)
}
function PesterExistFailureMessage($value) {
return "Expected: {$value} to exist"
}
function NotPesterExistFailureMessage($value) {
return "Expected: ${value} to not exist, but it was found"
}
|
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/PesterThrow.ps1 | PesterThrow.ps1 |
$ActualExceptionMessage = ""
$ActualExceptionWasThrown = $false
# because this is a script block, the user will have to
# wrap the code they want to assert on in { }
function PesterThrow([scriptblock] $script, $expectedErrorMessage) {
$Script:ActualExceptionMessage = ""
$Script:ActualExceptionWasThrow... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeLessThan.Tests.ps1 | BeLessThan.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterBeLessThan" {
It "passes if value Less than expected" {
Test-PositiveAssertion (PesterBeLessThan 1 2)
1 | Should BeLessThan 2
}
It "fails if values equal" {
Test-NegativeAssert... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeGreaterThan.ps1 | BeGreaterThan.ps1 | function PesterBeGreaterThan($value, $expected)
{
return [bool]($value -gt $expected)
}
function PesterBeGreaterThanFailureMessage($value,$expected)
{
return "Expected {$value} to be greater than {$expected}"
}
function NotPesterBeGreaterThanFailureMessage($value,$expected)
{
return "Expected ... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeNullOrEmpty.Tests.ps1 | BeNullOrEmpty.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterBeNullOrEmpty" {
It "should return true if null" {
Test-PositiveAssertion (PesterBeNullOrEmpty $null)
}
It "should return true if empty string" {
Test-PositiveAssertion (PesterBeNullOrEmp... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/MatchExactly.ps1 | MatchExactly.ps1 |
function PesterMatchExactly($value, $expectedMatch) {
return ($value -cmatch $expectedMatch)
}
function PesterMatchExactlyFailureMessage($value, $expectedMatch) {
return "Expected: {$value} to exactly match the expression {$expectedMatch}"
}
function NotPesterMatchExactlyFailureMessage($value, $expe... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Match.Tests.ps1 | Match.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Match" {
It "returns true for things that match" {
PesterMatch "foobar" "ob" | Should Be $true
}
It "returns false for things that do not match" {
PesterMatch "foobar" "slime" | Should Be $fals... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeGreaterThan.Tests.ps1 | BeGreaterThan.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterBeGreaterThan" {
It "passes if value greater than expected" {
Test-PositiveAssertion (PesterBeGreaterThan 2 1)
2 | Should BeGreaterThan 1
}
It "fails if values equal" {
Test-Ne... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Be.ps1 | Be.ps1 | #Be
function PesterBe($value, $expected) {
return ($expected -eq $value)
}
function PesterBeFailureMessage($value, $expected) {
if (-not (($expected -is [string]) -and ($value -is [string])))
{
return "Expected: {$expected}`nBut was: {$value}"
}
<#joining the output strings to a ... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Contain.Tests.ps1 | Contain.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterContain" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1`nrush is awesome"
It "returns true if the file contains the specified content" {
Test-PositiveAsserti... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Test-Assertion.ps1 | Test-Assertion.ps1 |
function Test-PositiveAssertion($result) {
if (-not $result) {
throw "Expecting expression to pass, but it failed"
}
}
function Test-NegativeAssertion($result) {
if ($result) {
throw "Expecting expression to pass, but it failed"
}
}
|
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Contain.ps1 | Contain.ps1 |
function PesterContain($file, $contentExpecation) {
return ((Get-Content $file) -match $contentExpecation)
}
function PesterContainFailureMessage($file, $contentExpecation) {
return "Expected: file ${file} to contain {$contentExpecation}"
}
function NotPesterContainFailureMessage($file, $contentExpe... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Should.ps1 | Should.ps1 | function Parse-ShouldArgs([array] $shouldArgs) {
if ($null -eq $shouldArgs) { $shouldArgs = @() }
$parsedArgs = @{
PositiveAssertion = $true
ExpectedValue = $null
}
$assertionMethodIndex = 0
$expectedValueIndex = 1
if ($shouldArgs.Count -gt 0 -and $shouldArgs[0].T... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Exist.Tests.ps1 | Exist.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterExist" {
It "returns true for paths that exist" {
Test-PositiveAssertion (PesterExist $TestDrive)
}
It "returns false for paths do not exist" {
Test-NegativeAssertion (PesterExist "$TestD... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/BeLessThan.ps1 | BeLessThan.ps1 | function PesterBeLessThan($value, $expected)
{
return [bool]($value -lt $expected)
}
function PesterBeLessThanFailureMessage($value,$expected)
{
return "Expected {$value} to be less than {$expected}"
}
function NotPesterBeLessThanFailureMessage($value,$expected)
{
return "Expected {$value} to ... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/Be.Tests.ps1 | Be.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterBe" {
It "returns true if the 2 arguments are equal" {
Test-PositiveAssertion (PesterBe 1 1)
}
It "returns true if the 2 arguments are equal and have different case" {
Test-PositiveAssertio... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/ContainExactly.Tests.ps1 | ContainExactly.Tests.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "PesterContainExactly" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1`nPester is awesome"
It "returns true if the file contains the specified content exactly" {
Tes... |
PowerShellCorpus/Github/ligershark_nuget-powershell/contrib/Pester/Functions/Assertions/ContainExactly.ps1 | ContainExactly.ps1 |
function PesterContainExactly($file, $contentExpecation) {
return ((Get-Content $file) -cmatch $contentExpecation)
}
function PesterContainExactlyFailureMessage($file, $contentExpecation) {
return "Expected: file ${file} to contain exactly {$contentExpecation}"
}
function NotPesterContainExactlyFail... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/TFS_ChangeMailer_V2_Perforce.ps1 | TFS_ChangeMailer_V2_Perforce.ps1 | ######### TFS_ChangeMailer.ps1 #######
##### Contact: STELI 6/5/2014 #####
# Version 2 - Change tickets filtered by service, like VSTF or Perforce.
$SmtpServer = "smtphost.redmond.corp.microsoft.com"
$From = "bgitnot@microsoft.com"
$To = "pfsupp@microsoft.com"
$Service = "Perforce" # VSTF | Perforce | SD |... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/TFS_ChangeMailer_V2.ps1 | TFS_ChangeMailer_V2.ps1 | ######### TFS_ChangeMailer.ps1 #######
##### Contact: STELI 6/5/2014 #####
# Version 2 - Change tickets filtered by service, like VSTF or Perforce.
$SmtpServer = "smtphost.redmond.corp.microsoft.com"
$From = "tfsnot@microsoft.com"
$To = "bgittfs@microsoft.com"
$Service = "VSTF" # VSTF | Perforce | SD | PS
... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/GetTotalSizeofAllDBs.ps1 | GetTotalSizeofAllDBs.ps1 | [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[System.Collections.ArrayList]$DBFileList = @()
function Connect-SQL ($SQL, $DBName)
{
$Conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
$Conn.applicationName = "PowerShell GetSQLDBInfo (using ... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/DTSBugReport.ps1 | DTSBugReport.ps1 | #Configure the basic authentication header
$personalAccessToken = "eda4zuwcydu54ndsmaabvsfleezaxeb6lpq6mmzsk3klxajb3k4q"
$Header = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($personalAccessToken)")) }
$RootURL = "https://mseng.visualstudio.com/defaultcollection/"
$P... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/TFS_ChangeCubeDataSourceConnectionString.ps1 | TFS_ChangeCubeDataSourceConnectionString.ps1 | [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") | Out-Null
# Get connection string first
Add-Type -AssemblyName "Microsoft.AnalysisServices.AdomdClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
$connectionectionString = "Data Source=TFSSCOCOLAP;Provider=... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/TFS_ChangeFileGrowth.ps1 | TFS_ChangeFileGrowth.ps1 | # Only works with the database with one db file and one log file.
$names = Invoke-Sqlcmd -ServerInstance CNSTELIDESK -Database test -Query "select servername, dbname from filegrowth where servername like 'CO1%'"
foreach ($name in $names)
{
$servername = $name.servername
$DBNAMEs = $name.dbname
... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/TFS_ChangeMailer_V1.ps1 | TFS_ChangeMailer_V1.ps1 | ######### TFS_ChangeMailer.ps1 #######
##### Contact: STELI 6/5/2014 #####
# Version 1 - Include all the change tickets
$SmtpServer = "smtphost.redmond.corp.microsoft.com"
$From = "tfsnot@microsoft.com"
$To = "bgittfs@microsoft.com"
$SQLQuery = "DECLARE @Today DATETIME
SET Datefirst 1
SET @Today = Ge... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/GetData.ps1 | GetData.ps1 | $LN1s = Invoke-Sqlcmd -ServerInstance tk5bgtalissql01 -Database talis -Query "select s.serverid, s.servername, v.instanceName from servers s left join vserverservice v on s.serverid = v.serverid where s.configurationtypeid = 4 and s.active = 1 and s.servername not in ('TFSEvalLN') and v.instancename is not null
union ... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/TFS_MonitorAO_1.ps1 | TFS_MonitorAO_1.ps1 | # AlwaysOn Health Monitor V4
# STELI @ 3/23/2015
#=============================================
# SCRIPT VARIABLES
#=============================================
$SMTPServer = "bgitgfssmtp.redmond.corp.microsoft.com"
$SMTPPort = 25
$EmailFrom = "tfsnot@microsoft.com"
$EmailTo = "bgita01@microsoft.com"
$D... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/TFS_MonitorAO_3.ps1 | TFS_MonitorAO_3.ps1 | # AlwaysOn Health Monitor V4
# STELI @ 3/23/2015
#=============================================
# SCRIPT VARIABLES
#=============================================
$SMTPServer = "bgitgfssmtp.redmond.corp.microsoft.com"
$SMTPPort = 25
$EmailFrom = "tfsnot@microsoft.com"
$EmailTo = "bgita01@microsoft.com"
$D... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/TFS_MonitorAO_2.ps1 | TFS_MonitorAO_2.ps1 | # AlwaysOn Health Monitor V4
# STELI @ 3/23/2015
#=============================================
# SCRIPT VARIABLES
#=============================================
$SMTPServer = "bgitgfssmtp.redmond.corp.microsoft.com"
$SMTPPort = 25
$EmailFrom = "tfsnot@microsoft.com"
$EmailTo = "bgita01@microsoft.com"
$D... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/TFS_AOMonitor_ReplicatevServerService.ps1 | TFS_AOMonitor_ReplicatevServerService.ps1 | . .\invoke-sqlcmd2.ps1
. .\write-datatable.ps1
$p = Get-Content D:\PWD\encrypted_password.txt | ConvertTo-SecureString
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "TalisAzureRO",$p
$u = $credentials.UserName
$pwd = $credentials.GetNetworkCredential().password
... |
PowerShellCorpus/Github/xstarlee_TestGitRepo/AO/TFS_MonitorAO_Resume.ps1 | TFS_MonitorAO_Resume.ps1 | # AlwaysOn Health Monitor V4
# STELI @ 3/23/2015
#=============================================
# SCRIPT VARIABLES
#=============================================
$DBServer = "TFSUTL01SQL"
$DBName = "AOMonitor"
$tbl_suspendreplica = "AOMonitorSuspendReplica"
$tbl_SuspendDatabase = "AOMonitorSuspendDatabase"
... |
PowerShellCorpus/Github/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$srcFiles = Join-Path $installPath "lib\net40\*.dll"
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$destDirec... |
PowerShellCorpus/Github/lfrigodesouza_MVC/AspNetMvc/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$srcDirectory = Join-Path $... |
PowerShellCorpus/Github/lfrigodesouza_MVC/AspNetMvc/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/lfrigodesouza_MVC/AspNetMvc/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/lfrigodesouza_MVC/AspNetMvc/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1 | install.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'
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory... |
PowerShellCorpus/Github/erangaskp_bio/Eranga-8023501/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/erangaskp_bio/Eranga-8023501/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/erangaskp_bio/Eranga-8023501/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/erangaskp_bio/Eranga-8023501/packages/EntityFramework.6.0.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/erangaskp_bio/Eranga-8023501/packages/EntityFramework.6.0.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/erangaskp_bio/Eranga-8023501/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/erangaskp_bio/Eranga-8023501/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/erangaskp_bio/Eranga-8023501/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$srcFiles = Join-Path $installPath "lib\net40\*.dll"
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$destDirec... |
PowerShellCorpus/Github/marisolxd_vetstore/Vetstorexd/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$srcDirectory = Join-Path $... |
PowerShellCorpus/Github/marisolxd_vetstore/Vetstorexd/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/marisolxd_vetstore/Vetstorexd/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/marisolxd_vetstore/Vetstorexd/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1 | install.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'
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/packages/EntityFramework.6.0.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/leanhvua7_BTGK.Vu/packages/EntityFramework.6.0.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/leanhvua7_BTGK.Vu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net45/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net451/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net46/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net40/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/leanhvu/packages/EntityFramework.6.0.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/leanhvua7_BTGK.Vu/leanhvu/packages/EntityFramework.6.0.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/leanhvua7_BTGK.Vu/leanhvu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net45/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/leanhvu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net451/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/leanhvu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net46/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/leanhvu/packages/System.Data.SQLite.EF6.1.0.98.1/tools/net40/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/leanhvua7_BTGK.Vu/leanhvu/leanhvu/packages/EntityFramework.6.0.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/leanhvua7_BTGK.Vu/leanhvu/leanhvu/packages/EntityFramework.6.0.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.