full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-EncodedBXORCommand.ps1
Out-EncodedBXORCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-ObfuscatedStringCommand.ps1
Out-ObfuscatedStringCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Invoke-Obfuscation.ps1
Invoke-Obfuscation.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-EncodedBinaryCommand.ps1
Out-EncodedBinaryCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-EncodedAsciiCommand.ps1
Out-EncodedAsciiCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-ObfuscatedTokenCommand.ps1
Out-ObfuscatedTokenCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/danielbohannon_Invoke-Obfuscation/Out-EncodedHexCommand.ps1
Out-EncodedHexCommand.ps1
# This file is part of Invoke-Obfuscation. # # Copyright 2017 Daniel Bohannon <@danielhbohannon> # while at Mandiant <http://www.mandiant.com> # # 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 ...
PowerShellCorpus/Github/GONZALORUIZ_MultiVNET/ValidateTemplate.ps1
ValidateTemplate.ps1
function DeployTemplate() { Param ( [string] $templateFileLocation, [string] $parametersFileLocation, [string] $resourceGroupName, [string] $deploymentName , [string] $resourceLocation ) if (-not (Get-AzureResourceGroup | ? ResourceGroupName...
PowerShellCorpus/Github/GONZALORUIZ_MultiVNET/VNET.ps1
VNET.ps1
# http://blogs.technet.com/b/keithmayer/archive/2015/07/13/how-to-building-vnet-to-vnet-connections-with-azure-resource-manager-and-powershell-in-5-steps.aspx # Create VNET1, if it doesn't already exist $prefix ="tsearchdv" $rgName = "tsearchdv" $location =" North Europe" $location2 = "West Europe" $tags = ...
PowerShellCorpus/Github/vincentkbg_CustomerApplication/Customers Application/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/vincentkbg_CustomerApplication/Customers Application/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/vincentkbg_CustomerApplication/Customers Application/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/OPS-E2E-PPE_E2E_D_Provision_2017_4_25_31_58_23/.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/RickvanOsta_Sudoku/Sudoku/packages/MvvmLight.5.0.2.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # find the App.xaml file $appxaml = $project.ProjectItems | where {$_.Name -eq "App.xaml"} $appxamlPath = ($appxaml.Properties | where {$_.Name -eq "LocalPath"}).Value # find the CSPROJ file $projectPath = ($project.Properties | where {$_.Name -eq "LocalPat...
PowerShellCorpus/Github/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/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/RickvanOsta_Sudoku/Sudoku/packages/EntityFramework.6.1.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/RickvanOsta_Sudoku/Sudoku/packages/EntityFramework.6.1.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/mycloudrevolution_PlasterConfig/Preperation/MyCustomPlasterTemplate-Prepare.ps1
MyCustomPlasterTemplate-Prepare.ps1
$manifestProperties = @{ Path = $env:USERPROFILE + '\Documents\GitHub\PlasterConfig\Templates\plasterManifest.xml' Title = 'My Custom Plaster Template' TemplateName = 'MyCustomPlasterTemplate' TemplateVersion = '0.0.1' Author = 'Markus Kraus' } New-PlasterManifest @manifestProperties
PowerShellCorpus/Github/mycloudrevolution_PlasterConfig/Templates/MyCustomPlasterTemplate-Template/helper/Create-Docs.ps1
Create-Docs.ps1
$moduleRoot = Resolve-Path "$PSScriptRoot\.." Import-Module (Join-Path $moduleRoot "<%=$PLASTER_PARAM_ModuleName%>.psm1") -force $verbs = (Get-Command -Module '<%=$PLASTER_PARAM_ModuleName%>' | ForEach-Object -Process { $_.Name.Split('-')[0] } | Select-Object -Unique) foreach ($verb in $verbs) { ...
PowerShellCorpus/Github/mycloudrevolution_PlasterConfig/Templates/MyCustomPlasterTemplate-Template/helper/Update-PowerShellGallery.ps1
Update-PowerShellGallery.ps1
<# .SYNOPSIS Push or update your module to the PowerShell Gallery. .DESCRIPTION Push or update your module to the PowerShell Gallery. Keep your API Key confidential! .PARAMETER Path The path to the module folder .PARAMETER ApiKey ...
PowerShellCorpus/Github/mycloudrevolution_PlasterConfig/Templates/MyCustomPlasterTemplate-Template/helper/Update-ModuleManifestData.ps1
Update-ModuleManifestData.ps1
<# .SYNOPSIS Bump the version of a module manifest file .DESCRIPTION Increment the version number of a module manifest file by following the Semantic Versioning standard -> http://semver.org/ It is possible to update either the MAJOR,MINOR or PATCH patch version of the...
PowerShellCorpus/Github/mycloudrevolution_PlasterConfig/Templates/MyCustomPlasterTemplate-Template/tests/MyCustomPlasterTemplate-BasicTest.ps1
MyCustomPlasterTemplate-BasicTest.ps1
$moduleRoot = Resolve-Path "$PSScriptRoot\.." $moduleName = "<%=$PLASTER_PARAM_ModuleName%>" Describe "General project validation: $moduleName" { $scripts = Get-ChildItem $moduleRoot -Include *.ps1, *.psm1, *.psd1 -Recurse # TestCases are splatted to the script so we need hashtables $testCase = $...
PowerShellCorpus/Github/platta_PSMultiLog/Tests/PSMultiLog.tests.ps1
PSMultiLog.tests.ps1
$ParentPath = Split-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) -Parent Import-Module -Name (Join-Path -Path $ParentPath -ChildPath "PSMultiLog.psm1") #------------------------------------------------------------------------------- # File Logging #-----------------------------------...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_12_17_59_6/.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/psake-yaml_psake-yaml/NuGetPackageBuilder.ps1
NuGetPackageBuilder.ps1
$scriptpath = $MyInvocation.MyCommand.Path $dir = Split-Path $scriptpath $manifestPath = Join-Path $dir psake.psd1 try { $manifest = Test-ModuleManifest -Path $manifestPath -WarningAction SilentlyContinue -ErrorAction Stop $version = $manifest.Version.ToString() } catch { throw } "Version nu...
PowerShellCorpus/Github/psake-yaml_psake-yaml/psake-config.ps1
psake-config.ps1
<# ------------------------------------------------------------------- Defaults ------------------------------------------------------------------- $config.buildFileName="default.ps1" $config.framework = "4.0" $config.taskNameFormat="Executing {0}" $config.verboseError=$false $config.coloredOutput = $true $config.modul...
PowerShellCorpus/Github/psake-yaml_psake-yaml/LoadYaml.ps1
LoadYaml.ps1
# Copyright 2016 Cloudbase Solutions Srl # # 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 appl...
PowerShellCorpus/Github/psake-yaml_psake-yaml/psake-buildTester.ps1
psake-buildTester.ps1
function Main() { write-host "Running psake build tests" -ForeGroundColor GREEN remove-module psake -ea SilentlyContinue import-module .\psake.psm1 $psake.run_by_psake_build_tester = $true $results = runBuilds remove-module psake "" $results | Sort 'Name' | % { if ($_.Result -eq "Passed") { write-hos...
PowerShellCorpus/Github/psake-yaml_psake-yaml/psake.ps1
psake.ps1
# Helper script for those who want to run psake without importing the module. # Example run from PowerShell: # .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" # Must match parameter definitions for psake.psm1/invoke-psake # otherwise named parameter binding fails param( [Parameter(Position=0,Mandatory=0)...
PowerShellCorpus/Github/psake-yaml_psake-yaml/nuget/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package) $psakeModule = Join-Path $toolsPath psake.psm1 import-module $psakeModule
PowerShellCorpus/Github/psake-yaml_psake-yaml/nuget/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$nugetPath = $env:ChocolateyInstall $nugetExePath = Join-Path $nuGetPath 'bin' $packageBatchFileName = Join-Path $nugetExePath "psake.bat" $psakeDir = (Split-Path -parent $MyInvocation.MyCommand.Definition) #$path = ($psakeDir | Split-Path | Join-Path -ChildPath 'psake.cmd') $path = Join-Path $psakeDir 'psake.cmd' W...
PowerShellCorpus/Github/psake-yaml_psake-yaml/tabexpansion/PsakeTabExpansion.ps1
PsakeTabExpansion.ps1
$global:psakeSwitches = @('-docs', '-task', '-properties', '-parameters') function script:psakeSwitches($filter) { $psakeSwitches | where { $_ -like "$filter*" } } function script:psakeDocs($filter, $file) { if ($file -eq $null -or $file -eq '') { $file = 'default.ps1' } psake $file -docs | out-string...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/docs_should_pass.ps1
docs_should_pass.ps1
Task default -depends CheckDocs Task CheckDocs { $doc = Invoke-psake .\nested\docs.ps1 -docs -nologo | Out-String $expectedDoc = @" Name Alias Depends On Default Description ---- ----- ---------- ------- ----------- ...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/simple_properties_and_tasks_should_pass.ps1
simple_properties_and_tasks_should_pass.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 }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_initialization_block_should_pass.ps1
using_initialization_block_should_pass.ps1
properties { $container = @{} $container.foo = "foo" $container.bar = $null $foo = 1 $bar = 1 } task default -depends TestInit task TestInit { # values are: # 1: original # 2: overide # 3: new Assert ($container.foo -eq "foo") "$container.foo should be foo" Assert ($container.bar ...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_precondition_should_pass.ps1
using_precondition_should_pass.ps1
task default -depends A,B,C task A { "TaskA" } task B -precondition { return $false } { "TaskB" } task C -precondition { return $true } { "TaskC" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/duplicate_alias_should_fail.ps1
duplicate_alias_should_fail.ps1
task default task A -alias a {} task B -alias b {} task C -alias a {}
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_postcondition_should_pass.ps1
using_postcondition_should_pass.ps1
task default -depends A,B,C task A { "TaskA" } task B -postcondition { return $true } { "TaskB" } task C { "TaskC" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/calling_invoke-task_should_pass.ps1
calling_invoke-task_should_pass.ps1
task default -depends A,B task A { } task B { "inside task B before calling task C" invoke-task C "inside task B after calling task C" } task C { }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/executing_module_function_that_depends_on_another_module_should_pass.ps1
executing_module_function_that_depends_on_another_module_should_pass.ps1
task default -depends test task test { invoke-psake modules\default.ps1 }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/failing_postcondition_should_fail.ps1
failing_postcondition_should_fail.ps1
task default -depends A,B,C task A { "TaskA" } task B -postcondition { return $false } { "TaskB" } task C { "TaskC" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/missing_task_should_fail.ps1
missing_task_should_fail.ps1
task default -depends Test task Test -depends Compile, Clean { Write-Host "Running PSake" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_properties_should_pass.ps1
using_properties_should_pass.ps1
properties { $x = $null $y = $null $z = $null } task default -depends TestProperties task TestProperties { Assert ($x -ne $null) "x should not be null" Assert ($y -ne $null) "y should not be null" Assert ($z -eq $null) "z should be null" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/bad_PreAndPostActions_should_fail.ps1
bad_PreAndPostActions_should_fail.ps1
task default -depends Test task Test -depends Compile, Clean -PreAction {"Pre-Test"} -PostAction {"Post-Test"} task Compile -depends Clean { "Compile" } task Clean { "Clean" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/dotNet4.6.1_should_pass.ps1
dotNet4.6.1_should_pass.ps1
Framework "4.6.1" task default -depends MsBuild task MsBuild { $output = &msbuild /version 2>&1 Assert ($output -NotLike "14.0") '$output should contain 14.0' }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/dotNet4_should_pass.ps1
dotNet4_should_pass.ps1
Framework '4.0' task default -depends MsBuild task MsBuild { exec { msbuild /version } }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/nested_builds_that_fail_should_fail.ps1
nested_builds_that_fail_should_fail.ps1
Task default -Depends RunAlwaysFail Task RunAlwaysFail { Invoke-psake .\nested\always_fail.ps1 }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_msbuild_should_pass.ps1
using_msbuild_should_pass.ps1
task default -depends DisplayNotice task DisplayNotice { exec { msbuild /version } }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/duplicate_tasks_should_fail.ps1
duplicate_tasks_should_fail.ps1
task A {} task B {} task A {}
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/multiline_blocks_should_pass.ps1
multiline_blocks_should_pass.ps1
task default -depends doStuff task doStuff { "Starting to do stuff..." "Adding stuff... 1 + 1 =" + (1+1) "Stuff done!" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/whatif_preference_should_pass.ps1
whatif_preference_should_pass.ps1
Task default -Depends RunWhatIf Task RunWhatIf { try { ## Setup the -whatif flag globally $global:WhatIfPreference = $true ## Ensure that psake ends up by calling something with -whatif e.g. Set-Item $parameters = @{p1='whatifcheck';} Invoke-psake .\nested\whatifpreference.ps1 -parameters $p...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/nested_builds_should_pass.ps1
nested_builds_should_pass.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/psake-yaml_psake-yaml/specs/using_PreAndPostActions_should_pass.ps1
using_PreAndPostActions_should_pass.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/psake-yaml_psake-yaml/specs/using_required_when_set_should_pass.ps1
using_required_when_set_should_pass.ps1
properties { $x = $null $y = $null } task default -depends TestRequired task TestRequired -requiredVariables x, y { }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/writing_psake_variables_should_pass.ps1
writing_psake_variables_should_pass.ps1
properties { $x = 1 } task default -depends Verify task Verify -description "This task verifies psake's variables" { #Verify the exported module variables cd variable: Assert (Test-Path "psake") "variable psake was not exported from module" Assert ($psake.ContainsKey("build_success")) "'psake' variable d...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/nonzero_lastexitcode_should_pass.ps1
nonzero_lastexitcode_should_pass.ps1
task default -depends MSBuildWithError task MSBuildWithError { msbuild ThisFileDoesNotExist.sln }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/detailedDocs_should_pass.ps1
detailedDocs_should_pass.ps1
Task default -depends CheckDetailedDocs Task CheckDetailedDocs { $doc = Invoke-psake .\nested\docs.ps1 -detailedDocs -nologo | Out-String $expectedDoc = @" Name : Compile Alias : Description : Depends On : CompileSolutionA, CompileSolutionB Default : True Name : C...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/task_with_alias_and_dependencies_should_pass.ps1
task_with_alias_and_dependencies_should_pass.ps1
task default -depends Task_With_Alias task Task_With_Alias -depends Task_Dependency -alias twa {} task Task_Dependency {}
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/running_aspnet_compiler_under_dotNet35_should_pass.ps1
running_aspnet_compiler_under_dotNet35_should_pass.ps1
Framework '3.5' task default -depends AspNetCompiler task AspNetCompiler { aspnet_compiler if ($LastExitCode -ne 1) { throw 'Error: Could not execute aspnet_compiler' } $global:LastExitCode = 0 }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_framework_should_pass.ps1
using_framework_should_pass.ps1
task default -depends FrameworkFunction task FrameworkFunction { AssertFramework '2.0' '2.0' '2.0' AssertFramework '3.5' '3.5' '2.0' AssertFramework '4.0' '4.6' '4.0' } function AssertFramework{ param( [string]$framework, [string]$engineVersion, [string]$frameworkVersion ) Framework $framework $msBuildV...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/dotNet4.6_should_pass.ps1
dotNet4.6_should_pass.ps1
Framework "4.6" task default -depends MsBuild task MsBuild { $output = &msbuild /version 2>&1 Assert ($output -NotLike "14.0") '$output should contain 14.0' }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_exec_and_nonzero_lastexitcode_should_fail.ps1
using_exec_and_nonzero_lastexitcode_should_fail.ps1
task default -depends MSBuildWithError task MSBuildWithError { exec { msbuild ThisFileDoesNotExist.sln } }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/explicitly_specified_32bit_build_should_pass.ps1
explicitly_specified_32bit_build_should_pass.ps1
Framework '4.0x86' task default -depends MsBuild task MsBuild { exec { msbuild /version } }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/circular_dependency_in_tasks_should_fail.ps1
circular_dependency_in_tasks_should_fail.ps1
task default -depends A task A -depends B { } task B -depends A { }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/dotNet4.5.1_should_pass.ps1
dotNet4.5.1_should_pass.ps1
Framework "4.5.1x86" task default -depends MsBuild task MsBuild { $output = &msbuild /version 2>&1 Assert ($output -NotLike "12.0") '$output should contain 12.0' }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/Get-PSakeScriptTasks_should_pass.ps1
Get-PSakeScriptTasks_should_pass.ps1
Task default -depends CheckGetPSakeScriptTasks function Assert-EqualArrays($a, $b, $message) { $differences = @(Compare-Object $a $b -SyncWindow 0) if ($differences.Length -gt 0) { $differences } Assert ($differences.Length -eq 0) "$message : $($differences.Length) differences foun...
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/default_task_with_action_should_fail.ps1
default_task_with_action_should_fail.ps1
task default { "Starting to do stuff..." "Adding stuff... 1 + 1 =" + (1+1) "Stuff done!" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/task_with_alias_should_pass.ps1
task_with_alias_should_pass.ps1
task default -depends twbdn task Task_With_Big_Descriptve_Name -alias twbdn { "Doing stuff inside task with alias" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/tasksetup_should_pass.ps1
tasksetup_should_pass.ps1
TaskSetup { "executing task setup" } Task default -depends Compile, Test, Deploy Task Compile { "Compiling" } Task Test -depends Compile { "Testing" } Task Deploy -depends Test { "Deploying" }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_required_when_not_set_should_fail.ps1
using_required_when_not_set_should_fail.ps1
properties { $x = $null $y = $null $z = $null } task default -depends TestProperties task TestProperties -requiredVariables z{ }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/using_parameters_should_pass.ps1
using_parameters_should_pass.ps1
properties { $my_property = $p1 + $p2 } task default -depends TestParams task TestParams { Assert ($my_property -ne $null) '$my_property should not be null' }
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/modules/psake-config.ps1
psake-config.ps1
$config.modules = @("ModuleA.psm1", "ModuleB.psm1") $config.moduleScope = "global"
PowerShellCorpus/Github/psake-yaml_psake-yaml/specs/modules/default.ps1
default.ps1
task default -depends test task test { Execute-ModuleAFunction }
PowerShellCorpus/Github/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/specs/nested/whatifpreference.ps1
whatifpreference.ps1
Task default -Depends WhatIfCheck Task WhatIfCheck { Assert ($p1 -eq 'whatifcheck') '$p1 was not whatifcheck' }
PowerShellCorpus/Github/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/specs/nested/always_fail.ps1
always_fail.ps1
Task default -Depends AlwaysFail Task AlwaysFail { Assert $false "This should always fail." }
PowerShellCorpus/Github/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/examples/msbuild40.ps1
msbuild40.ps1
Framework "4.0" # Framework "4.0x64" task default -depends ShowMsBuildVersion task ShowMsBuildVersion { msbuild /version }
PowerShellCorpus/Github/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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/psake-yaml_psake-yaml/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...