full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/Install-DotCoverPackage.ps1
Install-DotCoverPackage.ps1
<# .SYNOPSIS Install JetBrains.dotCover.CommandLineTools to RedGate.Build\packages .DESCRIPTION Install the JetBrains.dotCover.CommandLineTools nuget package to RedGate.Build\packages #> function Install-DotCoverPackage { [CmdletBinding()] param( # The version of the nuget package containing DotCov...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/New-NuGetPackageVersion.ps1
New-NuGetPackageVersion.ps1
#requires -Version 2 <# .SYNOPSIS Obtains a NuGet package version based on the build version number and branch name. .DESCRIPTION Obtains a NuGet package version based on a 3 or 4-digit build version number, the branch name and whether or not the branch is the default branch. .OUTPUTS A NuGet version str...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/Get-NugetPackagesFromProject.ps1
Get-NugetPackagesFromProject.ps1
<# .SYNOPSIS Computes a list of nuget packages used by a Visual Studio project file. .DESCRIPTION The list of nuget package is generated based on the values of the <HintPath /> property of every <reference /> used in the project. This is useful to ensure that packages.config for our projects contain ALL the r...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/Install-NUnitPackage.ps1
Install-NUnitPackage.ps1
<# .SYNOPSIS Install NUnit.Runners to RedGate.Build\packages .DESCRIPTION Install the NUnit.Runners nuget package to RedGate.Build\packages #> function Install-NUnitPackage { [CmdletBinding()] param( # The version of the nuget package containing the NUnit executables (NUnit.Runners) [string] $...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/Select-PackagesMissingFromProjectsPackagesConfig.ps1
Select-PackagesMissingFromProjectsPackagesConfig.ps1
<# .SYNOPSIS List the nuget packages that are missing from a VS project's packages.config file. .DESCRIPTION This guesses what packages should be referenced based on the values of the <HintPath /> properties. #> function Select-PackagesMissingFromProjectsPackagesConfig { [CmdletBinding()] param( ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Nuget/Update-NuspecDependenciesVersions.ps1
Update-NuspecDependenciesVersions.ps1
<# .SYNOPSIS Update the dependencies versions inside a given nuspec file. .DESCRIPTION Update the dependencies versions inside the nuspec files by looking at the list of nuget packages that are being used in the VS solution. #> function Update-NuspecDependenciesVersions { [CmdletBinding()] param(...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Tests/Test-ScriptForParsingErrors.ps1
Test-ScriptForParsingErrors.ps1
<# .SYNOPSIS Test a powershell script for parsing errors .DESCRIPTION Parse a powershell script (without executing it) and throws parsing exceptions if any .EXAMPLE Test-ScriptForParsingErrors -Path C:\myscript.ps1 Will parse C:\myscript.ps1 and throw exceptions if parsing errors are encounte...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Tests/Test-NugetPackagesVersionsAreConsistent.ps1
Test-NugetPackagesVersionsAreConsistent.ps1
#requires -Version 4.0 <# .SYNOPSIS Test for nuget packages having duplicate versions accross a list of packages.config .DESCRIPTION From a list of packages.config file, test for nuget packages that are listed with more than a single version. If packages with more than a single version are foun...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/Tests/Test-Admin.ps1
Test-Admin.ps1
<# .SYNOPSIS Determines if the console is elevated .DESCRIPTION Returns true if running as an administrator, false otherwise. #> function Test-Admin { $identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object System.Security.Principal.WindowsPrincipal( $ident...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/GitHub/Update-PullRequest.ps1
Update-PullRequest.ps1
<# .SYNOPSIS Update an existing GitHub pull request .DESCRIPTION Can change assigned users. .EXAMPLE Update-PullRequest -Repo RedGate.Build -Id 27 -Assignees user1, user2 Assign user1 and user2 to pull request 27 of repo 'red-gate/RedGate.Build' #> Function Update-PullRequest { [Cmdle...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/GitHub/Push-GitChangesToBranch.ps1
Push-GitChangesToBranch.ps1
<# .SYNOPSIS Commit every change and push force to a given branch .DESCRIPTION Create a commit containing all the changes in the current git repo. Force-push that commit to a git branch .EXAMPLE Push-GitChangesToBranch -BranchName 'my-branch' -CommitMessage 'This is my commit message' Wi...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/GitHub/New-PullRequest.ps1
New-PullRequest.ps1
<# .SYNOPSIS Opens a PR on GitHub .DESCRIPTION Opens a PR on GitHub .PARAMETER Token A github API token wioth full Repo permissions .PARAMETER Repo The name of the repository .PARAMETER Title The Title of the PR .PARA...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/GitHub/Get-PullRequest.ps1
Get-PullRequest.ps1
<# .SYNOPSIS Gets an Open PR from GitHub .DESCRIPTION Gets an Open PR from GitHub .PARAMETER Token A github API token wioth full Repo permissions .PARAMETER Repo The name of the repository to search .PARAMETER Head The head branch...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/GitHub/New-PullRequestWithProperties.ps1
New-PullRequestWithProperties.ps1
<# .SYNOPSIS Create a new pull request / update an existing pull request with a list of assigness or labels .DESCRIPTION If a pull request is not opened yet, create a new one and assign it to a list of github users If a pull request already exists, assign it to a list of github users .OUTPUTS ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/VisualStudio/Get-ProjectsFromSolution.ps1
Get-ProjectsFromSolution.ps1
<# .SYNOPSIS List the projects from a Visual Studio solution file .DESCRIPTION List all the projects from a Visual Studio solution file as well as display some of their property. (TargetFrameworkVersion) #> function Get-ProjectsFromSolution { [CmdletBinding()] Param ( # The...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/VisualStudio/Get-ProjectOutputPaths.ps1
Get-ProjectOutputPaths.ps1
<# .SYNOPSIS Return the OutputPath value set in a VS project file .DESCRIPTION Open the project file, read and return the value(s) of OutputPath #> function Get-ProjectOutputPaths { param( # The path to a .csproj or .vbproj file. (msbuild format) [string] $ProjectFile ) ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/VisualStudio/Get-ProjectTargetFramework.ps1
Get-ProjectTargetFramework.ps1
<# .SYNOPSIS Return the TargetFrameworkVersion value set in a VS project file .DESCRIPTION Open the project file, read and return the value of TargetFrameworkVersion #> function Get-ProjectTargetFramework { [CmdletBinding()] param( # The path to a .csproj or .vbproj file. (msbuild for...
PowerShellCorpus/Github/red-gate_RedGate.Build/Public/VisualStudio/Set-ProjectOutputPaths.ps1
Set-ProjectOutputPaths.ps1
<# .SYNOPSIS Set the value of the OutputPath properties in a VS project file .DESCRIPTION Open the project file, abd overwrite the value of any OutputPath property Note that this does not support setting different OutputPath depending on PropertyGroup condition. bin\$(Configuration) is pr...
PowerShellCorpus/Github/red-gate_RedGate.Build/scripts/test-singleassembly.ps1
test-singleassembly.ps1
<# .SYNOPSIS Invoke-Build script to execute tests from a NUnit assembly. .DESCRIPTION This script is packaged along with RedGate.Build to make it easy to execute NUnit test assemblies in parallel. It could be used like this from another Invoke-Build script: task TestsInParallel { $parallelTasks ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Select-ReleaseNotes.Tests.ps1
Select-ReleaseNotes.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Select-ReleaseNotes' { InModuleScope RedGate.Build { Context 'Two Part Version' { Mock Get-Content { '# 1.2' } $v = Select-ReleaseNotes -ProductName "Test" -ReleaseNotesPath 'DoesNotExist\RELEASENOTES.md' $v.Version |...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Update-AssemblyVersion.Tests.ps1
Update-AssemblyVersion.Tests.ps1
#requires -Version 2 -Modules Pester Describe 'Update-AssemblyVersion' { BeforeEach { $FilePath = [System.IO.Path]::GetTempFileName() } AfterEach { if (Test-Path $FilePath) { Remove-Item $FilePath } } function Set-FileContents($Contents) { ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Install-Package.Tests.ps1
Install-Package.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\.. Describe 'Install-Package' { if(Test-Path "$FullPathToModuleRoot\packages") { Remove-Item "$FullPathToModuleRoot\packages" -Force -Recurse } Context 'Happy Path - NUnit.Runners' { $resul...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/ConvertTo-ShellEscaped.Tests.ps1
ConvertTo-ShellEscaped.Tests.ps1
#requires -Version 2 -Modules Pester Describe 'ConvertTo-ShellEscaped' { $MemberDefinition = @" [DllImport("shell32.dll", SetLastError = true)] private static extern IntPtr CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, out int pNumArgs); public static string[] ToMainMethodArgsArr...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Invoke-SigningService.Tests.ps1
Invoke-SigningService.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Invoke-SigningService' { $testExeFile = New-Item 'TestDrive:\myfile.exe' -ItemType File $testVsixFile = New-Item 'TestDrive:\myfile.vsix' -ItemType File Context '-SigningServiceUrl is not passed in' { It 'should use value of $env:SigningS...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Format-WarningsAndErrors.Tests.ps1
Format-WarningsAndErrors.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Format-WarningsAndErrors' { Context 'When InputObject is not an error or a warning' { It 'should return InputObject unchanged - $null' { Format-WarningsAndErrors -InputObject $null | Should Be $null } It 'should return ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/PowershellHelp.Tests.ps1
PowershellHelp.Tests.ps1
#requires -Version 4 -Modules Pester # An Amazing test that will check that every function exported by this module does # indeed have its Powershell help well defined. Describe 'All exported functions help should be defined' { Get-Command -Module RedGate.Build | where { $_.Name -notlike '*TeamCity*'} | ForEac...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/New-TempDir.Tests.ps1
New-TempDir.Tests.ps1
#requires -Version 2 -Modules Pester Describe 'New-TempDir' { Context 'A newly created temporary directory' { $TempDir = New-TempDir It 'should exist' { $TempDir | Should Exist } It 'should contain \.temp\' { $TempDir | Should Match '\\\.temp\\...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Read-ReleaseNotes.Tests.ps1
Read-ReleaseNotes.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Read-ReleaseNotes' { InModuleScope RedGate.Build { Context 'Two Part Version' { Mock Get-Content { "# 1.2" } $info = Read-ReleaseNotes -ReleaseNotesPath "DoesNotExist\RELEASENOTES.md" $info.Content | Should Be "# 1.2"...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/New-NuGetPackageVersion.Tests.ps1
New-NuGetPackageVersion.Tests.ps1
#requires -Version 2 -Modules Pester Describe 'New-NuGetPackageVersion' { Context 'When IsDefaultBranch is true' { It 'should return the Version' { New-NuGetPackageVersion -Version '1.2.3.4' -IsDefaultBranch $True -BranchName 'master' | Should Be '1.2.3.4' } It 'should re...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/New-SemanticNuGetPackageVersion.Tests.ps1
New-SemanticNuGetPackageVersion.Tests.ps1
#requires -Version 2 -Modules Pester Describe 'New-SemanticNuGetPackageVersion' { Context 'When IsDefaultBranch is true' { It 'should return a semantic version for a 3-part version' { New-SemanticNuGetPackageVersion -Version '1.3.5' -IsDefaultBranch $True -BranchName 'master' | Should Be '...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nuget/Get-DependencyVersionRange.Tests.ps1
Get-DependencyVersionRange.Tests.ps1
#requires -Version 4 -Modules Pester . $PSScriptRoot\..\..\Private\Nuget\Get-DependencyVersionRange.ps1 Describe 'Get-DependencyVersionRange' { function ShouldThrowException($argument){ try { Get-DependencyVersionRange $argument throw 'Get-DependencyVersionRange should ha...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nuget/Get-NugetPackagesFromProject.Tests.ps1
Get-NugetPackagesFromProject.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Get-NugetPackagesFromProject' { $testProjectFile = New-Item 'TestDrive:\project.csproj' -ItemType File It 'should throw exception when project file path is null or empty' { {Get-NugetPackagesFromProject -ProjectFilePath ''} | Should Throw {Ge...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/2/Build-NUnitCommandLineArguments.Tests.ps1
Build-NUnitCommandLineArguments.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. . "$FullPathToModuleRoot\Private\NUnit\2\Build-NUnitCommandLineArguments.ps1" Describe 'Build-NUnitCommandLineArguments' { function Nunit2Parameters($assembly, $TestResult = 'TestResult') { "$assemb...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/2/Get-NUnitConsoleExePath.Tests.ps1
Get-NUnitConsoleExePath.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. . "$FullPathToModuleRoot\Private\NUnit\2\Get-NUnitConsoleExePath.ps1" Describe 'Get-NUnitConsoleExePath' { Context 'Nunit 2.6.4' { $result = Get-NUnitConsoleExePath -NUnitVersion '2.6.4' ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/2/Invoke-NUnitForAssembly.Tests.ps1
Invoke-NUnitForAssembly.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. Describe 'Invoke-NUnitForAssembly' { $tempFolder = New-Item "$FullPathToModuleRoot\.temp\nunit" -ItemType Directory -Force -Verbose Context 'Nunit 4.0' { It "should throw Unexpected NUnit versio...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/3/Invoke-NUnit3ForAssembly.Tests.ps1
Invoke-NUnit3ForAssembly.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. Describe 'Invoke-NUnit3ForAssembly' { Context 'Nunit 2.6.4' { It "should throw Unexpected NUnit version" { { Invoke-NUnit3ForAssembly -Assembly 'myassembly.dll' -NUnitVersion '2.6.4' } | S...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/3/Get-NUnit3ConsoleExePath.Tests.ps1
Get-NUnit3ConsoleExePath.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. . "$FullPathToModuleRoot\Private\NUnit\3\Get-NUnit3ConsoleExePath.ps1" Describe 'Get-NUnit3ConsoleExePath' { Context 'Nunit 3.2.0' { $result = Get-NUnit3ConsoleExePath -NUnitVersion '3.2.0' ...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Nunit/3/Build-NUnit3CommandLineArguments.Tests.ps1
Build-NUnit3CommandLineArguments.Tests.ps1
#requires -Version 4 -Modules Pester $FullPathToModuleRoot = Resolve-Path $PSScriptRoot\..\..\.. . "$FullPathToModuleRoot\Private\NUnit\3\Build-NUnit3CommandLineArguments.ps1" Describe 'Build-NUnit3CommandLineArguments' { function Nunit3Parameters($assembly, $TestResult = 'TestResult') { "$asse...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/Tests/Test-ScriptForParsingErrors.Tests.ps1
Test-ScriptForParsingErrors.Tests.ps1
#requires -Version 4 -Modules Pester Describe 'Test-ScriptForParsingErrors' { Context 'When a script has no error' { Mock -ModuleName RedGate.Build Get-Content { return @( '$i = 1', '$i++', 'throw "this is a test error"' )...
PowerShellCorpus/Github/red-gate_RedGate.Build/Tests/VisualStudio/Extract-NugetPackageFromHintPath.Tests.ps1
Extract-NugetPackageFromHintPath.Tests.ps1
#requires -Version 4 -Modules Pester . $PSScriptRoot\..\..\Private\VisualStudio\Extract-NugetPackageFromHintPath.ps1 Describe 'Extract-NugetPackageFromHintPath' { function ExtractNugetPackageFromHintPathAndAssert($hintpath, $expecteId, $expectedVersion) { $package = Extract-NugetPackageFromHintPat...
PowerShellCorpus/Github/puodzius_Check-EternalBlue/VerifyEternalBlue.ps1
VerifyEternalBlue.ps1
<# .SYNOPSIS Check if remote computers are patched against EternalBlue. .DESCRIPTION EternalBlue is used as a propagation mechanism. Patching the system does not mean that it is protected against the encryption routine. However, it means that the system is protected against the "wormness" of recent Wann...
PowerShellCorpus/Github/puodzius_Check-EternalBlue/Logging_Functions.ps1
Logging_Functions.ps1
Function Log-Start{ <# .SYNOPSIS Creates log file .DESCRIPTION Creates log file with path and name that is passed. Checks if log file exists, and if it does deletes it and creates a new one. Once created, writes initial logging data .PARAMETER LogPath Mandatory. Path of where log is ...
PowerShellCorpus/Github/BigBursar_PowerShellScripts/OutputContacts.ps1
OutputContacts.ps1
# Get login credentials to an Exchange server $cred = Get-Credential -Message "Log in with valid Username and Password" # Update the -ConnectionURI field with the name of an Exchange CAS server $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<servername>/powershell -Credential $c...
PowerShellCorpus/Github/BigBursar_PowerShellScripts/UpdateUsers.ps1
UpdateUsers.ps1
Import-Module ActiveDirectory # CSV file containing user details $ImportedUsers = Import-Csv "inputs\HR-Users-Export.csv" # Arrays to hold found and missing users $FoundUsers = @() $MissingUsers = @() $NoEmailUsers = @() [string]$EmailBody = "" #Loop through each user in the spreadsheet ForEach ($Impor...
PowerShellCorpus/Github/hmol_OtherCode/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
# Defines a new command in powershell, cd-, and yeah you guessed it. It does the same thing that cd - do in linux. # Go to previous dir. Put in about profile %USERNAME%\Documents\WindowsPowerShell\ # ( https://technet.microsoft.com/en-us/library/hh847857.aspx ) #####################################################...
PowerShellCorpus/Github/hmol_OtherCode/chocolatey script/run_on_new_dev_machine.ps1
run_on_new_dev_machine.ps1
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) choco install --allow-empty-checksums -y dropbox 1password procexp GoogleChrome visualstudio2015professional dotnetcore-runtime royalts git SourceTree adobereader dotTrace dotPeek winmerge fiddler Firefox notepadplusplus vlc 7zip kdi...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/sitecoreship.ps1
sitecoreship.ps1
Trace-VstsEnteringInvocation $MyInvocation $fileUrl = Get-VstsInput -Name fileUrl -Require $sitecoreUrl = Get-VstsInput -Name sitecoreUrl -Require Write-Host "Sitecore URL $sitecoreUrl" Write-Host "file URL $fileUrl" Write-Host "create httpclient" Add-Type -AssemblyName System.Net.Http $httpClientHandler...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/LongPathFunctions.ps1
LongPathFunctions.ps1
######################################## # Private functions. ######################################## function ConvertFrom-LongFormPath { [CmdletBinding()] param([string]$Path) if ($Path) { if ($Path.StartsWith('\\?\UNC')) { # E.g. \\?\UNC\server\share -> \\server\share ...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/OutFunctions.ps1
OutFunctions.ps1
# TODO: It would be better if the Out-Default function resolved the underlying Out-Default # command in the begin block. This would allow for supporting other modules that override # Out-Default. $script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default") ########...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1
ServerOMFunctions.ps1
<# .SYNOPSIS Gets a credentials object that can be used with the TFS extended client SDK. .DESCRIPTION The agent job token is used to construct the credentials object. The identity associated with the token depends on the scope selected in the build/release definition (either the project collection build/release ...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/FindFunctions.ps1
FindFunctions.ps1
<# .SYNOPSIS Finds files or directories. .DESCRIPTION Finds files or directories using advanced pattern matching. .PARAMETER LiteralDirectory Directory to search. .PARAMETER LegacyPattern Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns. Separate multiple...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1
LocalizationFunctions.ps1
$script:resourceStrings = @{ } <# .SYNOPSIS Gets a localized resource string. .DESCRIPTION Gets a localized resource string and optionally formats the string with arguments. If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/InputFunctions.ps1
InputFunctions.ps1
$script:secureInputs = @{ } <# .SYNOPSIS Gets an endpoint. .DESCRIPTION Gets an endpoint object for the specified endpoint name. The endpoint is returned as an object with three properties: Auth, Data, and Url. .PARAMETER Require Writes an error to the error pipeline if the endpoint is not found. #> func...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/TraceFunctions.ps1
TraceFunctions.ps1
<# .SYNOPSIS Writes verbose information about the invocation being entered. .DESCRIPTION Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced. .PARAM...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1
LoggingCommandFunctions.ps1
$script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`...
PowerShellCorpus/Github/Geertvdc_VSTS-Build-SitecoreShip/geertvdc-vsts-sitecoreship/ps_modules/VstsTaskSdk/ToolFunctions.ps1
ToolFunctions.ps1
<# .SYNOPSIS Asserts that a path exists. Throws if the path does not exist. .PARAMETER PassThru True to return the path. #> function Assert-Path { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$LiteralPath, [Microsoft.PowerShell.Commands.TestPathType]$PathT...
PowerShellCorpus/Github/hirokundayon_mamedeppo/mamedeppo.ps1
mamedeppo.ps1
<# PowerShell サブルーチン #> $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path . "$scriptPath\\mamedeppoSub.ps1" <# 引数で起動するWebブラウザを指定 #> $browser = $Args -join " "; <# ブラウザ起動 #> $driver=newSession $browser <# Windowを最大化 #> $response=maximizeWindow $driver <# Googleのページへ移動 #> $response=goURL...
PowerShellCorpus/Github/hirokundayon_mamedeppo/mamedeppoSub.ps1
mamedeppoSub.ps1
<# セッションを起動する #> function newSession($browser) { <# WebDriverのdllを指定 #> if ($PSVersionTable.PSCompatibleVersions.Major.Contains(4)) { Add-Type -Path "/path/to/selenium-dotnet\net40\WebDriver.dll"; } else { Add-Type -Path "/path/to/selenium-dotnet\net35\WebDriver.dll"; } <# chromedriverのパス #>...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/bimestre4/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/bimestre4/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/leonardortlima_trabalhos-navarro/bimestre4/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/leonardortlima_trabalhos-navarro/bimestre4/packages/jQuery.1.7.1.1/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/bimestre4/packages/jQuery.1.7.1.1/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11 if (-not $supportsJsIntelliSenseFile) { Write-Host "IntelliSense JS files are n...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/bimestre4/packages/jQuery.1.7.1.1/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/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/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/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/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/packages/jQuery.1.7.1.1/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/packages/jQuery.1.7.1.1/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11 if (-not $supportsJsIntelliSenseFile) { Write-Host "IntelliSense JS files are n...
PowerShellCorpus/Github/leonardortlima_trabalhos-navarro/TrabalhoBimestre3/packages/jQuery.1.7.1.1/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/dnmgns_packer-windows-templates/scripts/win-updates.ps1
win-updates.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500, $DoneScript='') #$Logfile = "c:\Windows\Temp\win-updates.log" $Host.UI.RawUI.WindowTitle = "Run Windows Updates" function LogWrite { Param ([string]$logstring) # $now =...
PowerShellCorpus/Github/dnmgns_packer-windows-templates/scripts/cloudbase.ps1
cloudbase.ps1
$Host.UI.RawUI.WindowTitle = "Downloading Cloudbase-Init..." $url = "http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta_x64.msi" (new-object System.Net.WebClient).DownloadFile($url, "C:\Windows\Temp\cloudbase-init.msi") $Host.UI.RawUI.WindowTitle = "Installing Cloudbase-Init..." $serialPortName = @(Get...
PowerShellCorpus/Github/dnmgns_packer-windows-templates/scripts/chocolatey.ps1
chocolatey.ps1
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
PowerShellCorpus/Github/exceedio_dsc/Install-DSCResourceKitModules.ps1
Install-DSCResourceKitModules.ps1
function Install-DSCResourceKitModules { Add-Type -assembly "System.IO.Compression.FileSystem" $zipurl = "https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d/file/131371/4/DSC%20Resource%20Kit%20Wave%2010%2004012015.zip" $zipfile = Join-Path $env:temp "dscmodules.zip" $...
PowerShellCorpus/Github/exceedio_dsc/Win2012R2SiteServer/Win2012R2SiteServer.ps1
Win2012R2SiteServer.ps1
param ( [Parameter(Mandatory)] [string] $ComputerName, [Parameter(Mandatory)] [string] $IPAddress, [Parameter(Mandatory)] [string] $DefaultGateway, [Parameter(Mandatory)] [string[]] $DNSAddress, [int] $SubnetMask = 24, [string] $LocalSourcePath = "$env:public...
PowerShellCorpus/Github/exceedio_dsc/TechnicianPC/TechnicianPC.ps1
TechnicianPC.ps1
Configuration TechnicianPC { param ( [string] $MachineName, [string] $Domain, [pscredential] $Credential ) Import-DscResource -ModuleName xComputerManagement Import-DscResource -ModuleName xPSDesiredStateConfiguration Import-DscResource -ModuleName xSmbSha...
PowerShellCorpus/Github/exceedio_dsc/ManagementPC/ManagementPC.ps1
ManagementPC.ps1
Configuration ManagementPC { param ( [string] $LocalSourcePath = "$env:public\Downloads" ) Import-DscResource -ModuleName xPSDesiredStateConfiguration Import-DscResource -ModuleName xSmbShare, xSystemSecurity, xWindowsUpdate Import-DscResource -ModuleName xRemoteDesktopAdmin, x...
PowerShellCorpus/Github/exceedio_dsc/ManagementPC/ManagementPCInstall.ps1
ManagementPCInstall.ps1
<# .SYNOPSIS Configures a management PC from scratch by installing the appropriate software and configuring the appropriate settings needed to manage an environment. .DESCRIPTION This script downloads and installs the RSAT for Windows 8.1 64-bit edition, installs the current DSC modul...
PowerShellCorpus/Github/ksagala_remove-oldaliases/remove-oldaliases.ps1
remove-oldaliases.ps1
# # Script removes unused mail aliases # (example removes all X.400 aliases) # you can also remove CCMAIL, MSMAIL, notes, or simple SMTP alias (e.g. *@domain.old) # for all distribution lists and mailboxes in Exchange organization # OF course you should earlier remove specific domain # from e-mail policies ...
PowerShellCorpus/Github/laurb_practice_rcd_ac/Sources/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/laurb_practice_rcd_ac/Sources/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/OPS-E2E-PPE_E2E_Provision_2017_4_13_28_5_19/.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/Abhisek1988_DevLabs/Artifacts/TestArtifact/TestPSScript.ps1
TestPSScript.ps1
New-Item -Path "c:\" -Name "TestArtifactDir" -ItemType "directory" Write-Verbose "The Directory has been created!!" -Verbose
PowerShellCorpus/Github/Stijnc_PowerShell.Module.Tests/Module.Tests.ps1
Module.Tests.ps1
#Requires -Modules Pester <# .SYNOPSIS Tests the AzureRateCard module .EXAMPLE Invoke-Pester .NOTES This script originated from work found here: https://github.com/kmarquette/PesterInAction scriptanalyzer section basics taken from DSCResource.Tests #> Import-Module -Name (Join-Path -Path $...
PowerShellCorpus/Github/SegaAges_PowerShell/hello-world.ps1
hello-world.ps1
#Begin new powershell script.
PowerShellCorpus/Github/Laskewitz_Blogs/EditOffice365Groups/SetGroups.ps1
SetGroups.ps1
# We need some credentials of course $UserCredential = Get-Credential # Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange ` -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $UserCredential ` -Authentication Basic -AllowRedirection Set...
PowerShellCorpus/Github/chriseyre2000_Powershell/CheckProject.ps1
CheckProject.ps1
<# .Synopsis Extracts the name and version number from a Nuget package name in the form PACKAGE.NAME.1.2.4 #> function Parts() { [CmdletBinding()] Param ( # Param1 help description [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, ...
PowerShellCorpus/Github/chriseyre2000_Powershell/Compare-PackageToProject.ps1
Compare-PackageToProject.ps1
function Compare-PackageToProject() { <# .Synopsis Compare the contents of the packages.config with the help paths in the csproj file to see if there are differences. Please note that some differences are to be expected. .EXAMPLE dir -Recurse *.Csproj | % {Compare-PackageToProject -Verbose $_} #> ...
PowerShellCorpus/Github/chriseyre2000_Powershell/Azure/query-azuretable.ps1
query-azuretable.ps1
# $edmlib = "D:\dev\github\Powershell\Azure\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll" $azurelib = "d:\dev\github\powershell\azure\windowsazure.storage.3.0.2.0\lib\net40\Microsoft.WindowsAzure.Storage.dll" $odata = "D:\dev\github\powershell\azure\Microsoft.Data.OData.5.6.0\lib\ne...
PowerShellCorpus/Github/chriseyre2000_Powershell/Azure/Newtonsoft.Json.5.0.8/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/chriseyre2000_Powershell/Generator/generator/generator.ps1
generator.ps1
<# .Synopsis Generator - used to create other generators. .NOTES This is an unusual generator - it put the generated generator into the generators directory. .ROLE This is part of the generator framework. .DESCRIPTION This is a generator used to create other generators. It accepts a single param...
PowerShellCorpus/Github/chriseyre2000_Powershell/Generator/Readme/readme.ps1
readme.ps1
<# .Synopsis Readme - generates readme.md files for github. .NOTES This was the first generator created. .ROLE This is part of the generator framework. .DESCRIPTION The arguments passed after the name of the generator form the starting content. #> param( [switch]$Force ) $template = @" R...
PowerShellCorpus/Github/chriseyre2000_Powershell/Psake.Azure/default.ps1
default.ps1
properties { $testMessage = 'Executed Test!' $compileMessage = 'Executed Compile!' $cleanMessage = 'Executed Clean!' } Framework "4.5.1" task default -depends Test task Test -depends Compile, Clean { $testMessage } task Compile -depends Clean { $compileMessage } task Clean { $clea...
PowerShellCorpus/Github/chriseyre2000_Powershell/Psake.Azure/psake.ps1
psake.ps1
# Helper script for those who want to run psake without importing the module. # Example: # .\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)] [string]$buil...
PowerShellCorpus/Github/kapitanov_SE_CustomFonts/generate.ps1
generate.ps1
param( [Parameter(Mandatory=$True,Position=1)] [string] $path, [Parameter(Mandatory=$True,Position=2)] [string] $font, [Parameter(Mandatory=$True,Position=3)] [string] $name ) # Generate font Write-Host "Running bmfontgen" -Foreground Cyan Write-Host "bmfontgen -output FontData -name $font -size 23 -bmsi...
PowerShellCorpus/Github/kimizhu_repotest1/.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/erlis_VsPsBld/tools/init.ps1
init.ps1
param( $installPath, $toolsPath, $package ) # find out where to put the files, we're going to create a Build folder at the solution level. $root = (get-item $installPath).parent.parent.fullname; $buildTarget = "$root\Build"; $buildSource = join-path $installPath 'Build' $copyFiles = $true; # create the ...
PowerShellCorpus/Github/erlis_VsPsBld/Build/Settings.ps1
Settings.ps1
# # TODO: Adjust the following values for your project # properties { # configuration to build. Possible values "Debug|Release" $configuration = "Release"; # path used as root for all other paths $base_folder = ".."; # the folder that will contains the build result. This folder is ...
PowerShellCorpus/Github/erlis_VsPsBld/Build/build.ps1
build.ps1
framework "4.0x86" $psake.use_exit_on_error = $true $ErrorActionPreference = "Stop" . .\settings.ps1 $global:file_to_build = ""; $global:build_type = ""; $global:project_folder = ""; $global:web_project = ""; $global:final_app_config_name = ""; $global:msbuild_outpu...
PowerShellCorpus/Github/erlis_VsPsBld/Build/lib/psake/init.ps1
init.ps1
param($installPath, $toolsPath, $package) $psakeModule = Join-Path $toolsPath psake.psm1 import-module $psakeModule @" ======================== psake - Automated builds with powershell ======================== "@ | Write-Host