full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Functions/PSUri/Test_Uri.ps1
Test_Uri.ps1
function Test_Uri { [CmdletBinding()] param( [string]$Uri, [bool]$DisableSSLValidation=$false, [string]$AllowedStatusCodeRegexp, [Int32]$TimeOutSeconds, [hashtable]$ReplaceRules ) $result = New-Object PsObject -Property @{ ComputerName = [System.Net.Dns]...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/Import-LocalModule.ps1
Import-LocalModule.ps1
# Load module from the local filesystem, instead from the ModulePath Remove-Module PSWebConfig -Force -ErrorAction SilentlyContinue Import-Module (Split-Path $PSScriptRoot -Parent) $script:FunctionPath = Resolve-Path (Join-Path $PSScriptRoot '../Functions') $script:FixturePath = Resolve-Path (Join-Path $PSScriptRoot '...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/Module/ScriptAnalyzer.tests.ps1
ScriptAnalyzer.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $scriptSources = Get-ChildItem -Path $script:FunctionPath -Filter '*.ps1' -Recurse $scriptAnalyzer = Get-Module PSScriptAnalyzer -ListAvailable if (-Not $scriptAnalyzer) { Write-Verbose "PSScriptAnalyzer module is not available." return } Describe "Scri...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/Module/Module.tests.ps1
Module.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $moduleName = 'PSWebConfig' $exportedCommands = (Get-Command -Module $moduleName) $expectedCommands = @( 'Get-PSWebConfig' 'Get-PSAppConfig' 'Decrypt-PSWebConfig' 'Unprotect-PSWebConfig' 'Test-PSWebConfig' 'Test-WebConfigFile' 'Test-...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSWebConfig/Get-WebConfig.tests.ps1
Get-WebConfig.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') $webConfigFile = Join-Path $script:FixturePath 'web.config' $webConfigSections = @( "appSettings" "connectionStrings" ) $testInput = New-Object -TypeName PsObject -Property @{ physicalPath = $webConfig...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSWebConfig/Get_ConfigFile.tests.ps1
Get_ConfigFile.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') Describe "Get_ConfigFile helper" { # Function to test . (Join-Path $script:FunctionPath 'PSWebConfig/Get_ConfigFile.ps1') $webConfigFile = Join-Path $script:FixturePath 'web.config' It "Should be ab...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSAppSetting/Get-PSAppSetting.tests.ps1
Get-PSAppSetting.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') $webConfigFile = Join-Path $script:FixturePath 'web.config' Describe 'Get-PSAppSetting' { Context 'Local web.config' { $config = Get-PSWebConfig -Path $webConfigFile -Verbose:$isVerbose $appSett...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSConnectionString/Test_ConnectionString.tests.ps1
Test_ConnectionString.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') Describe "Test_ConnectionString helper function" { # Function to test . (Join-Path $script:FunctionPath 'PSConnectionString/Test_ConnectionString.ps1') @{ Invalid='IvServer=localhost;IvDatabase=...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSConnectionString/Get-PSConnectionString.tests.ps1
Get-PSConnectionString.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') $webConfigFile = Join-Path $script:FixturePath 'web.config' Describe "Get-PSConnectionString" { Context "Local web.config connectionStrings section" { $config = Get-PSWebConfig -Path $webConfigFile -Ver...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSUri/Get-PSUri.tests.ps1
Get-PSUri.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') $webConfigFile = Join-Path $script:FixturePath 'web.config' Describe 'Get-PSUri' { Context 'Local web.config' { $config = Get-PSWebConfig -Path $webConfigFile -Verbose:$isVerbose $addresses = $c...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSUri/Test_Uri.tests.ps1
Test_Uri.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') Describe "Test_Uri helper function" { # Function to test . (Join-Path $script:FunctionPath 'PSUri/Test_Uri.ps1') Context "Testing multiple URIs and StatusCodes" { $uriTests = Import-Csv -Literal...
PowerShellCorpus/PowerShellGallery/PSWebConfig/1.7.0.0/Tests/PSUri/Get-PSEndpoint.tests.ps1
Get-PSEndpoint.tests.ps1
. (Join-Path $PSScriptRoot '../Import-LocalModule.ps1') $isVerbose=($VerbosePreference -eq 'Continue') $webConfigFile = Join-Path $script:FixturePath 'web.config' Describe "Get-PSEndpoint" { Context "Local web.config" { $config = Get-PSWebConfig -Path $webConfigFile -Verbose:$isVerbose $endpoints...
PowerShellCorpus/PowerShellGallery/DSCHelperFunctions/1.1.0/Examples/CertificateUpdate.ps1
CertificateUpdate.ps1
Configuration Meta { Node $AllNodes.NodeName { LocalConfigurationManager { CertificateId = $Node.Thumbprint RebootNodeIfNeeded = $true AllowModuleOverwrite = $true RefreshMode = "Pull" RefreshFrequencyMins = 15 ConfigurationMod...
PowerShellCorpus/PowerShellGallery/DSCHelperFunctions/1.1.0/Examples/Update-ConfigData.ps1
Update-ConfigData.ps1
#This parameter hastable contains common locations for "stuff". Most of these variables are "defaulted" in the functions. $Parameters = @{ PullServerConfiguration = "$env:PROGRAMFILES\WindowsPowershell\DscService\Configuration" CertStore = "$env:PROGRAMFILES\WindowsPowershell\DscService\NodeCertificates" ...
PowerShellCorpus/PowerShellGallery/DSCHelperFunctions/1.1.0/Examples/new-samplefiles.ps1
new-samplefiles.ps1
#Use this command to create "sample" files for password, node/guid, and certificate share. Install-DSCHelperStores
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Import-GraphOauthAccessToken.ps1
Import-GraphOauthAccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/9/2017 6:55 AM Edited on: 3/30/2017 Created by: Mark Kraus Organization: Mitel Filename: Import-GraphOauthAccess...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Update-GraphOauthAccessToken.ps1
Update-GraphOauthAccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/9/2017 7:43 AM Created by: Mark Kraus Organization: Mitel Filename: Update-GraphOauthAccessToken.ps1 ===================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADGroupById.ps1
Get-AADGroupById.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/14/2017 6:08 AM Edited On: 2/23/2017 Created by: Mark Kraus Organization: Filename: Get-AADGroupById.ps1 =====...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADServicePrinicpalbyDisplayName.ps1
Get-AADServicePrinicpalbyDisplayName.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 12:20 PM Last Edited: 2/14/2017 Created by: Mark Kraus Organization: Mitel Filename: Get-AADServicePrinicp...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADUserByID.ps1
Get-AADUserByID.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 10:38 AM Created by: Mark Kraus Organization: Mitel Filename: Get-AADUserByID.ps1 ==============================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADGroupMember.ps1
Get-AADGroupMember.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/14/2017 6:02 AM Edited on: 3/30/2017 Created by: Mark Kraus Organization: Mitel Filename: Get-AADGroupMember.ps1...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADUserByUserPrincipalName.ps1
Get-AADUserByUserPrincipalName.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 2:53 PM Edited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: Get-AADUserByUserPrinc...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Import-GraphApplication.ps1
Import-GraphApplication.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 8:32 AM Edited on: 3/30/2017 Created by: Mark Kraus Organization: Mitel Filename: Import-GraphApplication...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADServicePrincipalAppRoleAssignedTo.ps1
Get-AADServicePrincipalAppRoleAssignedTo.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 12:49 PM Last Modified: 2/14/2017 Created by: Mark Kraus Organization: Mitel Filename: Get-AADServicePrincip...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADServicePrinicpalbyId.ps1
Get-AADServicePrinicpalbyId.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 12:15 PM Created by: Mark Kraus Organization: Mitel Filename: Get-AADServicePrinicpalbyId.ps1 ==================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Remove-AADAppRoleAssignment.ps1
Remove-AADAppRoleAssignment.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 1:26 PM Created by: Mark Kraus Organization: Mitel Filename: Remove-AADAppRoleAssignment.ps1 ===================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADGroupByDisplayName.ps1
Get-AADGroupByDisplayName.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/14/2017 5:53 AM Edited on: 4/22/2017 Created by: Mark Kraus Organization: Filename: Get-AADGroupByDisplayName.p...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Invoke-GraphRequest.ps1
Invoke-GraphRequest.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 6:14 AM Edited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: Invoke-GraphRequest.ps...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/New-GraphOauthAccessToken.ps1
New-GraphOauthAccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/9/2017 5:46 AM Created by: Mark Kraus Organization: Mitel Filename: New-GraphOauthAccessToken.ps1 ======================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Export-GraphOauthAccessToken.ps1
Export-GraphOauthAccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/9/2017 5:25 AM Edited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: Export-GraphOauthAccess...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/New-GraphApplication.ps1
New-GraphApplication.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 7:34 AM Created by: Mark Kraus Organization: Mitel Filename: New-GraphApplication.ps1 ===========================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Add-AADAppRoleAssignment.ps1
Add-AADAppRoleAssignment.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/13/2017 1:59 PM Created by: Mark Kraus Organization: Mitel Filename: Add-AADAppRoleAssignment.ps1 ======================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Export-GraphApplication.ps1
Export-GraphApplication.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 8:26 AM Edited on: 2/14/2017 Created by: Mark Kraus Organization: Mitel Filename: Export-GraphApplication...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADUserAppRoleAssignment.ps1
Get-AADUserAppRoleAssignment.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/14/2017 5:17 AM Created by: Mark Kraus Organization: Mitel Filename: Get-AADUserAppRoleAssignment.ps1 ==================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-AADUserAll.ps1
Get-AADUserAll.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/14/2017 6:38 AM Created by: Mark Kraus Organization: Mitel Filename: Get-AADUserAll.ps1 ================================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-GraphOauthAccessToken.ps1
Get-GraphOauthAccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 10:26 AM Edited on:: 4/22/2017 Created by: Mark Kraus Organization: Filename: Get-GraphOauthAccessToken.p...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Public/Get-GraphOauthAuthorizationCode.ps1
Get-GraphOauthAuthorizationCode.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 8:48 AM Edited on: 2/27/2017 Created by: Mark Kraus Organization: Mitel Filename: Get-GraphOauthAuthoriza...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Types/MSGraphAPI.Oauth.Exception.ps1
MSGraphAPI.Oauth.Exception.ps1
<# .NOTES =========================================================================== Created with: VSCode Created on: 4/21/2017 6:51 PM Edited on: 4/21/2017 Created by: Mark Kraus Organization: Filename: MSGraphAPI.Oauth.Exception.ps1 ===============================================...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Types/MSGraphAPI.Application.ps1
MSGraphAPI.Application.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 8:24 AM Edited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: MSGraphAPI.Application....
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Types/MSGraphAPI.Oauth.AuthorizationCode.ps1
MSGraphAPI.Oauth.AuthorizationCode.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 10:19 AM Eedited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: MSGraphAPI.Oauth.Autho...
PowerShellCorpus/PowerShellGallery/psmsgraph/1.0.26.43/Types/MSGraphAPI.Oauth.AccessToken.ps1
MSGraphAPI.Oauth.AccessToken.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 Created on: 2/8/2017 2:05 PM Edited on: 2/16/2017 Created by: Mark Kraus Organization: Mitel Filename: MSGraphAPI.Oauth.Access...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Invoke-PublishToGallery.ps1
Invoke-PublishToGallery.ps1
#Invoke-Pester Publish-Module -Name New-OutputObject -NuGetApiKey de08953c-ed96-4633-a039-bac9385e88c7 -Verbose
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Private/Test-CharsInPath.ps1
Test-CharsInPath.ps1
Function Test-CharsInPath { <# .SYNOPSIS PowerShell function intended to verify if in the string what is the path to file or folder are incorrect chars. .DESCRIPTION PowerShell function intended to verify if in the string what is the path to file or folder are incorrect chars. Exit cod...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Private/Get-OverwriteDecision.ps1
Get-OverwriteDecision.ps1
function Get-OverwriteDecision { <# .SYNOPSIS Display dialog to user with question about overwrite file/folder. .DESCRIPTION PowerShell function intended to display dialog to user with a question about overwrite existing file/folder. Result/decission is returned as an exit code. E...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Public/New-OutputFile.ps1
New-OutputFile.ps1
Function New-OutputFile { <# .SYNOPSIS Function intended for preparing a PowerShell object for output files like reports or logs. .DESCRIPTION Function intended for preparing a PowerShell custom object what contains e.g. file name for output/create files like reports or log. The name is prepare...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Public/New-OutputFolder.ps1
New-OutputFolder.ps1
Function New-OutputFolder { <# .SYNOPSIS Function intended for preparing a PowerShell object for output/create folders for e.g. reports or logs. .DESCRIPTION Function intended for preparing a PowerShell custom object what contains e.g. folder name for output/create folders. The name is prepared...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Public/New-OutputObject.ps1
New-OutputObject.ps1
Function New-OutputObject { <# .SYNOPSIS Function intended for preparing a PowerShell object for output files like reports or logs. .DESCRIPTION Function intended for preparing a PowerShell custom object what contains e.g. file name for output/create files like reports or log. The name is p...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Tests/New-OutputObject-Module-Specific.Tests.ps1
New-OutputObject-Module-Specific.Tests.ps1
<# .SYNOPSIS Pester tests to general validation of the New-OutputObject module - e.g. help, PSScriptAnalyzer results, style rules .LINK https://github.com/it-praktyk/New-OutputObject .NOTES AUTHOR: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net KEYWORDS: PowerShell, Pester,...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Tests/Test-CharsInPath.Tests.ps1
Test-CharsInPath.Tests.ps1
<# .SYNOPSIS Pester tests for function Test-CharsInPath .LINK https://github.com/it-praktyk/New-OutputObject .LINK https://www.linkedin.com/in/sciesinskiwojciech .NOTES AUTHOR: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net KEYWORDS: PowerShell, FileSystem, Pest...
PowerShellCorpus/PowerShellGallery/New-OutputObject/0.9.9/Tests/New-OutputObject.Tests.ps1
New-OutputObject.Tests.ps1
<# .SYNOPSIS Pester tests to validate the New-OutputObject.ps1 function .LINK https://github.com/it-praktyk/New-OutputObject .NOTES AUTHOR: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net KEYWORDS: PowerShell, Pester, psd1, New-OutputObject, New-OutputObject CURRENT VER...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/psake.ps1
psake.ps1
# PSake makes variables declared here available in other scriptblocks # Init some things Properties { # Find the build folder based on build system $ProjectRoot = $ENV:BHProjectPath if(-not $ProjectRoot) { $ProjectRoot = $PSScriptRoot } $Timestamp = Get-date -uformat...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/deploy.psdeploy.ps1
deploy.psdeploy.ps1
# Generic module deployment. # This stuff should be moved to psake for a cleaner deployment view # ASSUMPTIONS: # folder structure of: # - RepoFolder # - This PSDeploy file # - ModuleName # - ModuleName.psd1 # Nuget key in $ENV:NugetApiKey # Set-BuildEnvironment from BuildHelpers module has populated...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/build.ps1
build.ps1
# Grab nuget bits, install modules, set build variables, start build. Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null Install-Module Psake, PSDeploy, Pester, BuildHelpers -force Import-Module Psake, BuildHelpers Set-BuildEnvironment Invoke-psake .\psake.ps1 exit ( [int]( -not $psake.build_success ) )
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/SendItemsToOutput.ps1
SendItemsToOutput.ps1
function SendItemsToOutput { Param ( [parameter()] [PSObject[]]$items, [parameter(Mandatory=$true)] [string[]]$typeName ) foreach ($i in $items) { $i.PSObject.TypeNames.Insert(0, $typeName) Write-Output $i } }
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/Join-Parts.ps1
Join-Parts.ps1
#Function used to join URL. #Credit to http://stackoverflow.com/questions/9593535/best-way-to-join-parts-with-a-separator-in-powershell function Join-Parts { param ( [parameter(ValueFromRemainingArguments=$true)] [string[]]$Parts = $null ) $Separator = "/" ($Parts | Where { $_ } | Foreac...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/GetItemsFromRabbitMQApi.ps1
GetItemsFromRabbitMQApi.ps1
function GetItemsFromRabbitMQApi { [CmdletBinding()] Param ( [parameter(Mandatory=$true, Position = 0)] [alias("HostName", "cn")] [string]$BaseUri = $defaultComputerName, [parameter(Mandatory=$true, Position = 1)] [PSCredential]$cred = $defaultCredentials, ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/ApplyFilter.ps1
ApplyFilter.ps1
function ApplyFilter { Param ( [parameter()] [PSObject[]]$items, [parameter(Mandatory=$true)] [string]$prop, [string[]]$name ) if (-not $name) { return $items } # apply property filter $filter = @() foreach($n in $name) { $f...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/NamesToString.ps1
NamesToString.ps1
function NamesToString { Param ( [string[]]$name, [string]$altText = "" ) if (-not $name) { return $altText } return $name -join ';' }
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/Invoke-RestMethod.ps1
Invoke-RestMethod.ps1
function Invoke-RestMethod { [CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=217034')] param( [Microsoft.PowerShell.Commands.WebRequestMethod] ${Method}, [Parameter(Mandatory=$true, Position=0)] [ValidateNotNullOrEmpty()] [uri] ${Uri}, [Mi...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/Constants.ps1
Constants.ps1
$defaultComputerName = "http://localhost:15672" $defaultVirtualhost = "/" $defaultUserName = "guest" $defaultPassword = "guest" $defaultCredentials = New-Object System.Management.Automation.PSCredential ($defaultUserName, $(ConvertTo-SecureString $defaultPassword -AsPlainText -Force))
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Private/PreventUnEscapeDotsAndSlashesOnUri.ps1
PreventUnEscapeDotsAndSlashesOnUri.ps1
if (-not $UnEscapeDotsAndSlashes) { Set-Variable -Scope Script -name UnEscapeDotsAndSlashes -value 0x2000000 } function GetUriParserFlags { $getSyntax = [System.UriParser].GetMethod("GetSyntax", 40) $flags = [System.UriParser].GetField("m_Flags", 36) $parser = $getSyntax.Invoke($null, "http") return ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQUser.ps1
Add-RabbitMQUser.ps1
<# .Synopsis Adds user to RabbitMQ server. .DESCRIPTION The Add-RabbitMQUser cmdlet allows to create new users in RabbitMQ server. To add a user to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more information go to: https://www.rab...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQConnection.ps1
Remove-RabbitMQConnection.ps1
<# .Synopsis Closes connection to RabbitMQ server. .DESCRIPTION The Remove-RabbitMQConnection allows for closing connection to the RabbitMQ server. This cmdlet is marked with High impact. To close connections to the remote server you need to provide -HostName parameter. You may pipe an object with names ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQVirtualHost.ps1
Remove-RabbitMQVirtualHost.ps1
<# .Synopsis Removes Virtual Hosts from RabbitMQ server. .DESCRIPTION The Remove-RabbitMQVirtualHost allows for removing Virtual Hosts in given RabbitMQ server. This cmdlet is marked with High impact. To remove Virtual Hosts from remote server you need to provide -HostName. You may pipe an object with na...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQUser.ps1
Remove-RabbitMQUser.ps1
<# .Synopsis Removes user from RabbitMQ server. .DESCRIPTION The Remove-RabbitMQUser cmdlet allows to delete users from RabbitMQ server. To remove a user from remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more information go to: http...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQQueue.ps1
Remove-RabbitMQQueue.ps1
<# .Synopsis Removes Queue from RabbitMQ server. .DESCRIPTION The Remove-RabbitMQQueue allows for removing queues in given RabbitMQ server. This cmdlet is marked with High impact. To remove Queue from remote server you need to provide -HostName. You may pipe an object with names and, optionally, with com...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQChannel.ps1
Get-RabbitMQChannel.ps1
<# .Synopsis Gets open RabbitMQ Channels. .DESCRIPTION The Get-RabbitMQChannel cmdlet gets list of opened channels. The cmdlet allows you to show list of opened channels or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.Channel objects. To get Nodes from remote serve...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQVirtualHost.ps1
Add-RabbitMQVirtualHost.ps1
<# .Synopsis Adds Virtual Hosts to RabbitMQ server. .DESCRIPTION The Add-RabbitMQVirtualHost allows for creating new Virtual Hosts in given RabbitMQ server. To add Virtual Hosts to remote server you need to provide -HostName. You may pipe an object with names and, optionally, with computer names to creat...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQConnection.ps1
Get-RabbitMQConnection.ps1
<# .Synopsis Gets Connections to the server. .DESCRIPTION The Get-RabbitMQConnection cmdlet gets connections to the RabbitMQ server. The cmdlet allows you to show all Connections or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.Connection objects. To get Connections...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQQueueBinding.ps1
Remove-RabbitMQQueueBinding.ps1
<# .Synopsis Removes binding between RabbitMQ Queue and Exchange. .DESCRIPTION The Remove-RabbitMQQueueBinding allows for removing bindings between RabbitMQ queues and exchanges. This cmdlet is marked with High impact. To remove Queue binding from remote server you need to provide -HostName. You may pipe...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Set-RabbitMQUser.ps1
Set-RabbitMQUser.ps1
<# .Synopsis Adds user to RabbitMQ server. .DESCRIPTION The Set-RabbitMQUser cmdlet allows to create new users in RabbitMQ server. To add a user to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more information go to: https://www.rab...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Move-RabbitMQMessage.ps1
Move-RabbitMQMessage.ps1
<# .Synopsis Moves messages from one RabbitMQ Queue to another. .DESCRIPTION The Move-RabbitMQMessage cmdlet allows to move messages from one RabbitMQ queue to another. Both source and destination queues must be in the same Virtual Host. The "exchange" and "routing_key" properties on moved messages will ba...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQVirtualHost.ps1
Get-RabbitMQVirtualHost.ps1
<# .Synopsis Gets Virtual Hosts registered with the server. .DESCRIPTION The Get-RabbitMQVirtualHost gets Virtual Hosts registered with RabbitMQ server. The cmdlet allows you to show all Virtual Hosts or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.VirtualHost objects....
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQQueueBinding.ps1
Add-RabbitMQQueueBinding.ps1
<# .Synopsis Adds binding between RabbitMQ exchange and queue. .DESCRIPTION The Add-RabbitMQQueueBinding binds RabbitMQ exchange with queue using RoutingKey To add QueueBinding to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more in...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQExchange.ps1
Remove-RabbitMQExchange.ps1
<# .Synopsis Removes Exchange from RabbitMQ server. .DESCRIPTION The Remove-RabbitMQExchange allows for removing exchanges in given RabbitMQ server. This cmdlet is marked with High impact. To remove Exchange from remote server you need to provide -HostName. You may pipe an object with names and, optional...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQExchange.ps1
Add-RabbitMQExchange.ps1
<# .Synopsis Adds Exchange to RabbitMQ server. .DESCRIPTION The Add-RabbitMQExchange allows for creating new Exchanges in given RabbitMQ server. To add Exchange to remote server you need to provide -HostName You may pipe an object with names and parameters, including HostName, to create multiple Exchange...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Remove-RabbitMQPermission.ps1
Remove-RabbitMQPermission.ps1
<# .Synopsis Removes permissions to virtual host for a user. .DESCRIPTION The Remove-RabbitMQPermission cmdlet allows to remove user permissions to virtual host. To remove permissions to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQMessage.ps1
Add-RabbitMQMessage.ps1
<# .Synopsis Gets messages from RabbitMQ Queue. .DESCRIPTION The Add-RabbitMQMessage cmdlet gets messages from RabbitMQ queue. The result may be zero, one or many RabbitMQ.Message objects. To get Connections from remote server you need to provide -HostName parameter. The cmdlet is using REST Api prov...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQUser.ps1
Get-RabbitMQUser.ps1
<# .Synopsis Gets list of users. .DESCRIPTION The Get-RabbitMQUser gets list of users registered in RabbitMQ server. The result may be zero, one or many RabbitMQ.User objects. To get users from remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management P...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Clear-RabbitMQQueue.ps1
Clear-RabbitMQQueue.ps1
<# .Synopsis Purges all messages from RabbitMQ Queue. .DESCRIPTION The Clear-RabbitMQQueue removes all messages from given RabbitMQ queue. To remove message from Queue on remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more informatio...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQNode.ps1
Get-RabbitMQNode.ps1
<# .Synopsis Gets RabbitMQ Nodes. .DESCRIPTION The Get-RabbitMQNode cmdlet gets nodes in RabbitMQ cluster. The cmdlet allows you to show list of cluster nodes or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.Node objects. To get Nodes from remote server you need to ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQQueue.ps1
Get-RabbitMQQueue.ps1
<# .Synopsis Gets open RabbitMQ Channels. .DESCRIPTION The Get-RabbitMQQueue cmdlet gets queues registered with RabbitMQ server. The cmdlet allows you to show list of all queues or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.Queue objects. To get Queues from remot...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Copy-RabbitMQMessage.ps1
Copy-RabbitMQMessage.ps1
<# .Synopsis Copies messages from one RabbitMQ Queue to another. .DESCRIPTION The Copy-RabbitMQMessage cmdlet allows to copy messages from one RabbitMQ queue to another. Both source and destination queues must be in the same Virtual Host. The "exchange" and "routing_key" properties on copied messages will ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQQueueBinding.ps1
Get-RabbitMQQueueBinding.ps1
<# .Synopsis Gets bindings for given RabbitMQ Queue. .DESCRIPTION The Get-RabbitMQQueueBinding cmdlet gets bindings for given RabbitMQ Queue. The cmdlet allows you to show all Bindings for given RabbitMQ Queue. The result may be zero, one or many RabbitMQ.Connection objects. To get Connections from re...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Register-RabbitMQServer.ps1
Register-RabbitMQServer.ps1
<# .Synopsis Registers RabbitMQ server. .DESCRIPTION Register-RabbitMQ server cmdlet allows to add RabbitMQ server to the tab completition list for HostName. .EXAMPLE Register-RabbitMQServer '127.0.0.1' Adds server 127.0.0.1 to auto completition list for HostName parameter. .EXAMPLE Register-RabbitMQ...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Set-RabbitMQPermission.ps1
Set-RabbitMQPermission.ps1
<# .Synopsis Updates permissions to virtual host for a user. .DESCRIPTION The Set-RabbitMQPermission cmdlet allows to update user permissions to virtual host. To update permissions to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For mor...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Unregister-RabbitMQServer.ps1
Unregister-RabbitMQServer.ps1
<# .Synopsis Unregisters RabbitMQ server. .DESCRIPTION Unregister-RabbitMQ server cmdlet allows to remove RabbitMQ server from tab completition list for HostName. .EXAMPLE Unregister-RabbitMQServer '127.0.0.1' Removes server 127.0.0.1 from auto completition list for HostName parameter. #> function Unregi...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQExchange.ps1
Get-RabbitMQExchange.ps1
<# .Synopsis Gets Virtual Hosts registered with the server. .DESCRIPTION The Get-RabbitMQVirtualHost gets Virtual Hosts registered with RabbitMQ server. The cmdlet allows you to show all Virtual Hosts or filter them by name using wildcards. The result may be zero, one or many RabbitMQ.VirtualHost objects....
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQMessage.ps1
Get-RabbitMQMessage.ps1
<# .Synopsis Gets messages from RabbitMQ Queue. .DESCRIPTION The Get-RabbitMQMessage cmdlet gets messages from RabbitMQ queue. The result may be zero, one or many RabbitMQ.Message objects. To get Connections from remote server you need to provide -HostName parameter. The cmdlet is using REST Api prov...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQPermission.ps1
Add-RabbitMQPermission.ps1
<# .Synopsis Adds permissions to virtual host for a user. .DESCRIPTION The Add-RabbitMQPermission cmdlet allows to add user permissions to virtual host. To add permissions to remote server you need to provide -HostName. The cmdlet is using REST Api provided by RabbitMQ Management Plugin. For more informa...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQOverview.ps1
Get-RabbitMQOverview.ps1
<# .Synopsis Get overview information about RabbitMQ server. .DESCRIPTION The Get-RabbitMQOverview gets overview information about one or more RabbitMQ servers. Returned object contains information about RabbitMQ server such as its version, Erlang version, node name, number of exchanges, queues, messages, co...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Add-RabbitMQQueue.ps1
Add-RabbitMQQueue.ps1
<# .Synopsis Adds Queue to RabbitMQ server. .DESCRIPTION The Add-RabbitMQQueue allows for creating new queues in RabbitMQ server. To add Queue to remote server you need to provide -HostName. You may pipe an object with Name, Queue parameters, VirtualHost and HostName to create multiple queues. For more i...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Public/Get-RabbitMQPermission.ps1
Get-RabbitMQPermission.ps1
<# .Synopsis Gets Permissions for VirtualHost and/or user. .DESCRIPTION The Get-RabbitMQPermission cmdlet shows permissions users have to work with virtual hosts. The cmdlet allows you to show all permissions or filter them by VirtualHost and/or User using wildcards. The result may be zero, one or many Ra...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/ScriptsToProcess/TabExpansions.ps1
TabExpansions.ps1
$BaseUriCompletion_Process = { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $global:RabbitMQServers } $virtualHostCompletion_Process = { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $parms = @{} if ($fakeB...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/GetOverview.Tests.ps1
GetOverview.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\TestSetup.ps1" . "$here\..\Public\Get-RabbitMQOverview.ps1" Describe -Tags "Example" "Get-RabbitMQOverview" { It "should get server overview" { $actual = Get-RabbitMQOverview -BaseUri $server | select -ExpandProperty HostName $actu...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/GetVirtualHost.Tests.ps1
GetVirtualHost.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\TestSetup.ps1" . "$here\..\Public\Get-RabbitMQVirtualHost.ps1" function SetUpTest($vhosts = ("vh1","vh2")) { Add-RabbitMQVirtualHost -BaseUri $server -Name $vhosts } function TearDownTest($vhosts = ("vh1","vh2")) { foreach($vhost in $v...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/TestSetup.ps1
TestSetup.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$server = "192.168.232.129" $server = "http://localhost:15672" . "$here\..\Private\Constants.ps1" . "$here\..\Private\Invoke-RestMethod.ps1" . "$here\..\Private\NamesToString.ps1" . "$here\..\Private\PreventUnEscapeDotsAndSlashesOnUri.ps1" . "$here\..\Private\Se...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/GetExchange.Tests.ps1
GetExchange.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\TestSetup.ps1" . "$here\..\Public\Get-RabbitMQExchange.ps1" Describe -Tags "Example" "Get-RabbitMQExchange" { It "should get Exchanges registered with the server" { $actual = Get-RabbitMQExchange -BaseUri $server | select -ExpandProperty n...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/RemoveExchange.Tests.ps1
RemoveExchange.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\TestSetup.ps1" . "$here\..\Public\Remove-RabbitMQExchange.ps1" Describe -Tags "Example" "Remove-RabbitMQExchange" { It "should remove existing Exchange" { Add-RabbitMQExchange -BaseUri $server -Name "e1" -Type direct Remove-RabbitMQE...
PowerShellCorpus/PowerShellGallery/RabbitMQTools/1.1/Tests/AddExchange.Tests.ps1
AddExchange.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path . "$here\TestSetup.ps1" . "$here\..\Public\Add-RabbitMQExchange.ps1" function TearDownTest() { $exchanges = Get-RabbitMQExchange -BaseUri $server -Name e1, e2 ($exchanges) | Remove-RabbitMQExchange -BaseUri $server -ErrorAction Continue -Confirm:$fa...