full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Examples/Build.examples.ps1
Build.examples.ps1
param( [Parameter()] [string]$Server = 'http://localhost:8085', [Parameter(Mandatory=$true)] [pscredential]$Credential ) # Use local module for the examples Remove-Module PsBamboo -ErrorAction SilentlyContinue $localModule = Join-Path (Split-Path $PSScriptRoot -Parent) "PsBamboo.psm1" Import-Module $l...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Invoke-BambooRestMethod.ps1
Invoke-BambooRestMethod.ps1
<# .SYNOPSIS Generic helper cmdlet to invoke Rest methods agains a target Bamboo server. .DESCRIPTION This cmdlet extends the original Invoke-RestMethod cmdlet with Bamboo REST API specific parameters, so it does user authorization and provides easier resource access. .PARAMETER Resource Mandatory ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Add_ObjectType.ps1
Add_ObjectType.ps1
<# .SYNOPSIS Helper cmdlet to insert an extra object typename for sutom views .DESCRIPTION It accepts any psobject from the pipeline and inserts the new typename to the beginning of the list .EXAMPLE Invoke-BambooRestMethod -Resource "plan/$PlanKey/artifact" | Expand-BambooResource -ResourceName 'ar...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Expand-BambooResource.ps1
Expand-BambooResource.ps1
<# .SYNOPSIS Helper cmdlet to convert Bamboo REST API responses to PS pipeline output .DESCRIPTION It accepts any response XML object as an input and expands it content by the -ResourceName parameter. .PARAMETER Response Mandatory - Response object as an input .PARAMETER ResourceName Mandatory - Nam...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Artifact/Get-BambooArtifact.ps1
Get-BambooArtifact.ps1
<# .SYNOPSIS Gets all the artifacts for a specific Bamboo Plan. .DESCRIPTION The cmdlet directly returns the artifact XML response from Bamboo .PARAMETER PlanKey Mandatory - Key for the Bamboo Plan. .EXAMPLE Get-BambooArtifact -PlanKey 'PRJ-PLANKEY' id name shared location copyPattern P...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildResult/Get-BambooResult.ps1
Get-BambooResult.ps1
<# .SYNOPSIS Gets build results for all or for a single Bamboo Plan. .DESCRIPTION If -PlanKey is specified it filters for only those build results. By default it returns the latest build results. .PARAMETER BuildKey Optional - Key for the exact Bamboo build to get the build results .PARAMETER PlanKey ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildQueue/Resume-BambooQueuedBuild.ps1
Resume-BambooQueuedBuild.ps1
New-Alias -Name Resume-BambooQueuedBuild -Value Resume-BambooBuild -Force -Scope Global
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildQueue/Get-BambooQueuedBuild.ps1
Get-BambooQueuedBuild.ps1
<# .SYNOPSIS Gets all or a specific queued build from build activities .DESCRIPTION If PlanKey parameter specified, it returns queued items for that single Plan, otherwise it returns all queued item for all Plans. .PARAMETER PlanKey Optional - Key for the Bamboo Plan to filter for specific queued it...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildQueue/Stop-BambooQueuedBuild.ps1
Stop-BambooQueuedBuild.ps1
<# .SYNOPSIS Stops and removes a queued build. .DESCRIPTION The cmdlet doesn't return any value about the stop attempt .PARAMETER BuildKey Mandatory - Key for the latest build to be aborted .EXAMPLE Stop-BambooBuild -BuildKey 'PRJ-PLANKEY' #> function Stop-BambooQueuedBuild { [CmdletBinding()] p...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Server/Set-BambooServer.ps1
Set-BambooServer.ps1
<# .SYNOPSIS Sets the target Bamboo Server .DESCRIPTION All further cmdlets from PsBamboo will be executed against the server-enpoint specified by this cmdlet. .PARAMETER Url Mandatory - Fully qualified HTTP endpoint for the target Bamboo Server. .EXAMPLE Set-BambooServer -Url "http://localhost:8085...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Server/Get-BambooInfo.ps1
Get-BambooInfo.ps1
<# .SYNOPSIS Gets the current Bamboo Server information and version Detail. .DESCRIPTION The cmdlet simply returns the .EXAMPLE Get-BambooInfo version : 5.9.4 edition : buildDate : 2015-08-16T00:22:28.000+12:00 buildNumber : 5919 state : RUNNING #> function Get-BambooIn...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Server/Get-BambooCurrentUser.ps1
Get-BambooCurrentUser.ps1
<# .SYNOPSIS Gets the Current user from the previously set BambooCredentials. .DESCRIPTION If BambooCredentials are not set earlier, this cmdlet fails with an unauthorized exception. .EXAMPLE Get-BambooCurrentUser #> function Get-BambooCurrentUser { [CmdletBinding()]param() Invoke-BambooRestMet...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Server/Get-BambooServer.ps1
Get-BambooServer.ps1
<# .SYNOPSIS Returns the currenly used Bamboo Server address. .DESCRIPTION This cmdlet is a simple getter function for Set-BambooServer cmdlet. .EXAMPLE Get-BambooServer #> function Get-BambooServer { $script:BambooServer }
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Server/Set-BambooAuthentication.ps1
Set-BambooAuthentication.ps1
<# .SYNOPSIS Sets the Authentication credential ad mode for the target Bamboo Server. .DESCRIPTION All further cmdlets from PsBamboo will be executed with the Authentication details passed by this command. .PARAMETER Credential Mandatory - PSCredential to be used to login to the target Bamboo server .PA...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Build/Resume-BambooBuild.ps1
Resume-BambooBuild.ps1
<# .SYNOPSIS Resumes or Continues a single suspended build. .DESCRIPTION If -ExecuteAllStages parameter is specified it continues a paused or manually suspended build. .PARAMETER BuildKey Mandatory - Key for the suspended/rested build .PARAMETER ExecuteAllStages Optional - Switch to instructs bamboo...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Build/Get-BambooBuild.ps1
Get-BambooBuild.ps1
New-Alias -Name Get-BambooBuild -Value Get-BambooResult -Force -Scope Global
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Build/Start-BambooBuild.ps1
Start-BambooBuild.ps1
<# .SYNOPSIS Triggers a build for the specified Plan. .DESCRIPTION The cmdlet returns the build details, if it succeeds. .PARAMETER PlanKey Mandatory - PlanKey for the latest build to be started .PARAMETER Stage Optional - Name of the stage which should be finished .PARAMETER ExecuteAllStages Option...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildLog/Get-BambooBuildLog.ps1
Get-BambooBuildLog.ps1
<# .SYNOPSIS Gets build logs for a single Stage in a Bamboo Build Result .DESCRIPTION It fetches the build result for a specific or latest build plan and returns it as text. .PARAMETER BuildKey Mandatory - Key for the exact Bamboo build to get the build results .PARAMETER StageKey Mandatory - Key f...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/BuildLog/Get-BambooResultLog.ps1
Get-BambooResultLog.ps1
New-Alias -Name Get-BambooResultLog -Value Get-BambooBuildLog -Force -Scope Global
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Plan/Disable-BambooPlan.ps1
Disable-BambooPlan.ps1
<# .SYNOPSIS Disables a Bamboo plan by its key. .DESCRIPTION It doesn't return any object if it succeeds. .PARAMETER PlanKey Mandatory - Key of the plan to be disabled .EXAMPLE Disable-BambooPlan -PlanKey 'PRJ-PLANKEY' #> function Disable-BambooPlan { [CmdletBinding()] param( [Parameter(...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Plan/Copy-BambooPlan.ps1
Copy-BambooPlan.ps1
<# .SYNOPSIS Clones / Copies a Bamboo plan to a new Plan. .DESCRIPTION If it succeeds, it returns the newly created plan details. .PARAMETER PlanKey Mandatory - Key of the plan to be copied .PARAMETER NewPlanKey Mandatory - New Plankey that will be created as a copy of the original PlanKey .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Plan/Get-BambooPlan.ps1
Get-BambooPlan.ps1
<# .SYNOPSIS Gets all plans or describes a single Bamboo Plan. .DESCRIPTION If -PlanKey is specified it describes only that plan. The Cmdlet supports pagination through the REST API, so it automatically fetches all items from all of the pages. .PARAMETER PlanKey Optional - Key for the Bamboo Plan ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Plan/Enable-BambooPlan.ps1
Enable-BambooPlan.ps1
<# .SYNOPSIS Enables a Bamboo plan by its key. .DESCRIPTION It doesn't return any object if it succeeds. .PARAMETER PlanKey Mandatory - Key of the plan to be enabled .EXAMPLE Enable-BambooPlan -PlanKey 'PRJ-PLANKEY' #> function Enable-BambooPlan { [CmdletBinding()] param( [Parameter()] ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/Project/Get-BambooProject.ps1
Get-BambooProject.ps1
<# .SYNOPSIS Gets all projects or describes a single Bamboo Project. .DESCRIPTION If -ProjectKey is specified it describes only that project. .PARAMETER ProjectKey Optional - Key for the Bamboo Project to be described .EXAMPLE Get-BambooProject .EXAMPLE Get-BambooProject -ProjectKey 'PRJ' #> functio...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/PlanBranch/Get-BambooPlanBranch.ps1
Get-BambooPlanBranch.ps1
<# .SYNOPSIS Gets all plan-branches or describes a single plan-branch for a Bamboo Plan. .DESCRIPTION If -BranchName is specified it describes only that plan-branch. .PARAMETER PlanKey Mandatory - Key for the parent Bamboo Plan .PARAMETER BranchName Optional - Name of the branch-plan to be described in ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/PlanBranch/Enable-BambooPlanBranch.ps1
Enable-BambooPlanBranch.ps1
<# .SYNOPSIS Enables a Bamboo plan-branch by its key. .DESCRIPTION It doesn't return any object if it succeeds. .PARAMETER PlanKey Mandatory - Key of the parent plan .PARAMETER PlanKey Mandatory - Name of the branch under the parent plan to be enabled .EXAMPLE Enable-BambooPlan -PlanKey 'PRJ-PLANKEY...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/PlanBranch/Disable-BambooPlanBranch.ps1
Disable-BambooPlanBranch.ps1
<# .SYNOPSIS Disables a Bamboo plan-branch by its key. .DESCRIPTION It doesn't return any object if it succeeds. .PARAMETER PlanKey Mandatory - Key of the parent plan .PARAMETER PlanKey Mandatory - Name of the branch under the parent plan to be disabled .EXAMPLE Disable-BambooPlanBranch -PlanKey 'PR...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Functions/PlanBranch/Add-BambooPlanBranch.ps1
Add-BambooPlanBranch.ps1
<# .SYNOPSIS Creates a new Plan Branch for a Bamboo Plan. .DESCRIPTION If -VcsBranch is not specified, it takes the -BranchName. .PARAMETER PlanKey Mandatory - Key for the Bamboo Plan for the branch-plan should be created .PARAMETER BranchName Mandatory - Name of the Branch-Plan .PARAMETER VcsBranch ...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Tests/TestCommon.ps1
TestCommon.ps1
# Common script level variables for tests $Script:ModuleName = 'PsBamboo' $Script:FunctionPath = Resolve-Path (Join-Path $PSScriptRoot '../Functions') # Load module from the local filesystem, instead from the ModulePath Remove-Module $Script:ModuleName -Force -ErrorAction SilentlyContinue Import-Module (Resolve-Path (...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Tests/Server/BambooServer.tests.ps1
BambooServer.tests.ps1
. (Join-Path $PSScriptRoot '../TestCommon.ps1') Describe "Bamboo Server cmdlets" { $expectedUrl = 'http://this-is-my-expected-url.com:1234' Context "Get-BambooServer" { $defaultUrl = 'http://localhost:8085' it "should have '$defaultUrl' as the default url" { Get-BambooServer | Shou...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Tests/Server/BambooAuthentication.tests.ps1
BambooAuthentication.tests.ps1
. (Join-Path $PSScriptRoot '../TestCommon.ps1') Describe "Set-BambooAuthentication" { # Mock data $SecurePassword = ConvertTo-SecureString 'Password' -AsPlainText -Force $credential = New-Object -TypeName pscredential ('UserName',$SecurePassword) $ExpectedToken='VXNlck5hbWU6UGFzc3dvcmQ=' Mock Invo...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Tests/BambooModule/ScriptAnalyzer.tests.ps1
ScriptAnalyzer.tests.ps1
. (Join-Path $PSScriptRoot '../TestCommon.ps1') $scriptSources = Get-ChildItem -Path $script:FunctionPath -Filter '*.ps1' -Recurse $scriptAnalyzer = Get-Module PSScriptAnalyzer -ListAvailable $excludeRuleList = @( 'PSUseShouldProcessForStateChangingFunctions' ) if (-Not $scriptAnalyzer) { Write-Warning "PSSc...
PowerShellCorpus/PowerShellGallery/PsBamboo/2.2.1.0/Tests/BambooModule/Module.tests.ps1
Module.tests.ps1
. (Join-Path $PSScriptRoot '../TestCommon.ps1') $exportedCommands = (Get-Command -Module $Script:ModuleName) $expectedCommands = Import-Csv -Path (Join-Path $PSScriptRoot 'expected_commands.csv') Describe "$($Script:ModuleName) Module" { It "Should be loaded" { Get-Module $Script:ModuleName | Should Not B...
PowerShellCorpus/PowerShellGallery/VMware.VimAutomation.License/6.5.1.5375648/VMware.VimAutomation.License.ps1
VMware.VimAutomation.License.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.VimAutomation.License.Commands", (Split-Path $script:MyInvocation.MyCommand.Path)); # This script contains additional module initialization routines function global:Get-LicensingCommand([string] $Name = "*") { ...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/09.log_levels.ps1
09.log_levels.ps1
<# If handlers are added to the logger at initialization time, no console handler is created, because we suppose that we need total control over the handlers. to create a default console handler, initiliaze first the logger, then add some handlers. We can also create the logger with -NoDefaultHandler param...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/02.eventlog.ps1
02.eventlog.ps1
Import-Module ..\uLog.psd1 -WarningAction SilentlyContinue -Force function test-log2 { Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog $log.AddLogHandler( (New-uLogEventLog -Keep:$false) ) Log-Info -Message 'Hello from test-log2' Log-Warning -Mess...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/13.log_mail.ps1
13.log_mail.ps1
<# test mail handler #> Write-Host "EXAMPLE 13" Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue if ($cred -eq $null){ $cred = Get-Credential } $log = New-uLog -NoHeader $mailHandler = New-uLogMa...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/11.log_keep_data.ps1
11.log_keep_data.ps1
<# If handlers are added to the logger at initialization time, no console handler is created, because we suppose that we need total control over the handlers. to create a default console handler, initiliaze first the logger, then add some handlers. We can also create the logger with -NoDefaultHandler param...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/05.disableLog.ps1
05.disableLog.ps1
#TOFIX: gestion du paramŤtre source qui ne fonctionne pas en console # faire un paramŤtre source par dťfault lors de la crťation, utilisez dynamicparam pour configurer $source & $path Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog $log.AddL...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/14.file-ccm.ps1
14.file-ccm.ps1
<# This example creates a log file with the SCCM log format. #> Write-Host "EXAMPLE 14" Import-Module ..\uLog.psd1 -Force -WarningAction SilentlyContinue Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue $local = New-uLogFile -Name lo...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/test.ps1
test.ps1
#TOFIX: gestion du paramŤtre source qui ne fonctionne pas en console # faire un paramŤtre source par dťfault lors de la crťation, utilisez dynamicparam pour configurer $source & $path Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog #$log.Add...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/04.eventlog_file.ps1
04.eventlog_file.ps1
Import-Module ..\uLog.psd1 -WarningAction SilentlyContinue -Force function test-log4 { Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog $log.AddLogHandler((New-uLogFile -Path 'c:\temp\testLog_test3_file.ps1.log')) $log.AddLogHandler((New-uLogEventLog -Name evt)) ...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/10.log_header.ps1
10.log_header.ps1
<# This example demonstrates the use of Header. Header contains basic information about the computer, user and PowerShell version. By default, it is printed beaucause it is of great use when debugging To remove the default header, use -NoHeader parameter #> Write-Host "EXAMPLE 10" Import-Module .....
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/08.default_Handler.ps1
08.default_Handler.ps1
<# If handlers are added to the logger at initialization time, no console handler is created, because we suppose that we need total control over the handlers. to create a default console handler, initiliaze first the logger, then add some handlers. We can also create the logger with -NoDefaultHandler param...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/03.file.ps1
03.file.ps1
Import-Module ..\uLog.psd1 -WarningAction SilentlyContinue function test-log3 { Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog $log.AddLogHandler((New-uLogFile -Path 'c:\temp\testLog_test3_file.ps1.log')) Log-Info -Message 'Hello from test-log3' Log-Warn...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/12.log_Include.ps1
12.log_Include.ps1
<# test Include functionnality only writes log to handlers specified by -Include #> Write-Host "EXAMPLE 12" Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue $log = New-uLog -NoHeader $log.AddLogHand...
PowerShellCorpus/PowerShellGallery/uLog/0.2.1.0/test/07.with_Levels.ps1
07.with_Levels.ps1
Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue $log = New-uLog $local = New-uLogFile -Name local $log.AddLogHandler($local) $temp = New-uLogFile -Name temp -Path c:\temp\test7_with_Levels.ps1.log $log.Ad...
PowerShellCorpus/PowerShellGallery/xDscDiagnostics/2.6.0.0/Tests/Unit/CollectDscDiagnotics.tests.ps1
CollectDscDiagnotics.tests.ps1
<# .Synopsis Unit tests for CollectDscDiagnostics.psm1 .DESCRIPTION .NOTES Code in HEADER and FOOTER regions are standard and may be moved into DSCResource.Tools in Future and therefore should not be altered if possible. #> # TODO: Customize these parameters... $Global:ModuleName = 'Colle...
PowerShellCorpus/PowerShellGallery/NonPSJob/1.0.0.4/Private/NonPSJobObject.ps1
NonPSJobObject.ps1
Class NonPSJob { [string]$Title [string]$Workplace [string]$Location [string]$Category [int]$NumberOfSeats [string]$Url [void]ApplyForJob() { Write-Host "Opening Url: $($this.Url)......." -ForegroundColor Green [System.Diagnostics.Process]::Start($this...
PowerShellCorpus/PowerShellGallery/NonPSJob/1.0.0.4/Public/Get-NonPSJob.ps1
Get-NonPSJob.ps1
<# .Synopsis Get employment objects from the Swedish employment service .DESCRIPTION Build PowerShell objects from the Swedish employment service. This is a example module that is used to demonstrate the use of PowerShell 5 and object based on classes. .PARAMETER Category What type of Job yo...
PowerShellCorpus/PowerShellGallery/NonPSJob/1.0.0.4/Public/Get-Propeller.ps1
Get-Propeller.ps1
Function Get-Propeller{ [System.Diagnostics.Process]::Start("http://www.propellerkeps.nu") | Out-Null }
PowerShellCorpus/PowerShellGallery/Performance/1.4.0.3/Add-PerformanceRecord.ps1
Add-PerformanceRecord.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER .INPUTS .OUTPUTS .EXAMPLE #> function Add-PerformanceRecord { [CmdletBinding()] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] $Name, [Parameter(Mandatory = $true, Position = 1)] [datetime] $Tim...
PowerShellCorpus/PowerShellGallery/Performance/1.4.0.3/Get-PerformanceRecord.ps1
Get-PerformanceRecord.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER .INPUTS .OUTPUTS .EXAMPLE #> function Get-PerformanceRecord { [CmdletBinding()] param ( $Name ) if ($Name) { ($script:PerformanceRecord).GetEnumerator() | Where-Object { $_.Name -eq $Name } } else { ($scri...
PowerShellCorpus/PowerShellGallery/Performance/1.4.0.3/Clear-PerformanceRecord.ps1
Clear-PerformanceRecord.ps1
<# .SYNOPSIS .DESCRIPTION .PARAMETER .INPUTS .OUTPUTS .EXAMPLE #> function Clear-PerformanceRecord { [CmdletBinding()] param ( ) if (Test-Path Variable:Script:PerformanceRecord) { $script:PerformanceRecord.Clear() } }
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/GetPoshAltiris.ps1
GetPoshAltiris.ps1
# This awesome installation script was actually developed by the makers of psget. Great module! param ( $url = "https://raw.githubusercontent.com/Tiberriver256/PowerShellSymantecAltirisASDK/master/PowerShellSymantecAltirisASDK.psm1" ) function Find-Proxy() { if ((Test-Path Env:HTTP_PROXY) -Or (Test-Path Env:HT...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/ConvertTo-Function.ps1
ConvertTo-Function.ps1
. .\ServiceToCmdletMappings.ps1 Function Create-HTMLDOMFromFile { Param( [String] $FileName, [String] $TagName, [Int] $OuputCount = 11 ) $HTML = New-Object -Com "HTMLFile"; $Content = Get-Content -Path $FileName -raw #To convert raw content to HTML DOM (Document object Model) ...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/AutoGeneratePSFunctions.ps1
AutoGeneratePSFunctions.ps1
Function AutoGeneratePSFunctions ($Server, $PowerShellASDKPath) { $WebServices = @( @{URI="http://$Server/altiris/ASDK.DeploymentSolution/DSTaskManagementService.asmx";ServiceName="DSTaskManagement"}, @{URI="http://$Server/altiris/ASDK.NS.SoftwareDelivery/SWDSolnAdvertisementManagementService.asmx";Service...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/ServiceToCmdletMappings.ps1
ServiceToCmdletMappings.ps1
$ServiceToCmdletMappings = @{ "AddExclusions" = "Add-CollectionExclusions" "AddInclusions" = "Add-CollectionInclusions" "CreateResourceCollection" = "New-Collection" "GetCollectionMembership" = "Get-CollectionMembership" "GetExclusions" = "Get-CollectionExclusions" "GetInclusions" = "Get-CollectionInclusions" "...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwareDeliveryPolicyManagement.ps1
SoftwareDeliveryPolicyManagement.ps1
Function Add-SoftwareDeliveryItem { <# .SYNOPSIS Add software resource or task to the policy. .PARAMETER policyGuid Policy Guid (existing or returned by CreatePolicy(String, String) method. .PARAMETER softwareOrTaskGuid Software resource guid or task guid. .EXAMPLE Add new software resource. C...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwareTasksManagement.ps1
SoftwareTasksManagement.ps1
Function New-SWTaskAssignPackagesToSoftwareResource { <# .SYNOPSIS Create Assign Packages To Software Resource Task. .PARAMETER packagesInfo String of "packages info". Package info string should contains GUID of package, company and version information separated by "|" delimetr. GUID string could not be emp...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwarePortalManagement.ps1
SoftwarePortalManagement.ps1
Function Add-SWPortalUserOrGroupToPublishingItem { <# .SYNOPSIS Add user/group to publishing item. .PARAMETER publishingItemGuid Publishing item guid. .PARAMETER userOrGroup User or group name. .PARAMETER preApproved True if published software/policy can be request by user without managers appro...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwarePackageManagement.ps1
SoftwarePackageManagement.ps1
Function Add-SWPackageFile { <# .SYNOPSIS Add file to software package .PARAMETER PackageGuid Guid of Software Package .PARAMETER File File or folder to be added to package .PARAMETER IgnoreAttributes ignore any attributes during save .EXAMPLE Add LicenseAgreement.txt to Orca package Copy...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SWDSolnAdvertisementManagement.ps1
SWDSolnAdvertisementManagement.ps1
Function New-SWDAdvertisement { <# .SYNOPSIS This ASDKMethod will be the basic method to save a AdvertisementItemEx. The rest of the parameters will be defaulted. (e.g.: Schedule would be Run ASAP) Like ItemDetails struct used in ItemManagementLib, AdvertisementExDetails would be a struct which would be specific ...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/CollectionManagement.ps1
CollectionManagement.ps1
Function Add-CollectionExclusions { <# .SYNOPSIS Add collections and/or resources to the set of excluded items for a collection. .PARAMETER collectionItemGuid The guid of the collection to add exclusions to. .PARAMETER itemGuids Guid or guids of collections and/or resources to add to the collection's ...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/HierarchyManagement.ps1
HierarchyManagement.ps1
Function New-HierarchyCustomEventRule { <# .SYNOPSIS Create a custom Hierarchy event replication rule .PARAMETER name the name of the rule .PARAMETER description rule description .PARAMETER enabled whether rule is enabled .PARAMETER customScheduleXml XML fragment defining a custom schedule...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/ResourceManagement.ps1
ResourceManagement.ps1
Function New-ResourceAssociation { <# .SYNOPSIS Creates a resource association between two resources .PARAMETER resourceAssociationTypeGuid the Resource Association Type .PARAMETER parentResourceGuid a GUID representing the parent resource in the association .PARAMETER childResourceGuid...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/ItemManagement.ps1
ItemManagement.ps1
Function Copy-AltirisItem { <# .SYNOPSIS Clones an item and names the new item. .PARAMETER itemGuid Guid of the item to clone .PARAMETER newItemName Name to be given to the new item .EXAMPLE CopyC# // See ItemManagementLib Overview for an example of setting up m_proxy. Guid AltirisCompanyResour...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/TaskManagement.ps1
TaskManagement.ps1
Function Invoke-Task { <# .SYNOPSIS Immediately executes a task or job. .PARAMETER taskGuid The guid of the task or job to execute. .PARAMETER executionName The name given to this instance of the task or job execution. .PARAMETER inputParameters Xml-formatted input parameters for the task or job...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/ReportManagement.ps1
ReportManagement.ps1
Function New-ReportUsingRawSql { <# .SYNOPSIS Create a new report using a raw SQL query as the data source. .PARAMETER reportName Name of the report item .PARAMETER reportDescription Description of the report item .PARAMETER dataSourceName Name used to describe the results of the SQL query used ...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/DSTaskManagement.ps1
DSTaskManagement.ps1
Function Invoke-DeploymentSolutionTask { <# .SYNOPSIS Performs some work in Deployment Solution. The CLI is being deprecated. Please see the CLI Programming Guide. RunDeploymentSolutionTask will create a new Task Server task, get resource information, change settings and create OS license keys, etc. .PARAMETER ...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/InventoryRuleManagement.ps1
InventoryRuleManagement.ps1
Function Add-Expression { <# .SYNOPSIS Merge two expressions into one .PARAMETER RuleExpression xml of expression. User can obtain an expression by calling functions CreateExpressionXXX .PARAMETER ParentOperation parent operation. The empty guid, {00000000-0000-0000-0000-000000000000} can be used to a...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/PatchManagement.ps1
PatchManagement.ps1
Function Add-PatchGuids { <# .SYNOPSIS .PARAMETER guidItem .PARAMETER name .PARAMETER guidList .PARAMETER setback .EXAMPLE .NOTES #> param ( [Parameter(Mandatory=$true)] [string]$guidItem, [Parameter(Mandatory=$true)] [string]$name, [Parameter(Man...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwareCommandLineManagement.ps1
SoftwareCommandLineManagement.ps1
Function New-CommandLine { <# .SYNOPSIS Create new command line item .PARAMETER Name Name .PARAMETER Description Description (can be empty) .PARAMETER SoftwarePackageGuid GUID of package if command line requires package (you can use the empty guid {00000000-0000-0000-0000-000000000000} if Softwa...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SWDSolnProgramManagement.ps1
SWDSolnProgramManagement.ps1
Function Set-SWDSoftwarePortalSecurity { <# .SYNOPSIS This ASDK Method assigns the software Portal security settings on a ProgramEx. Action would be either Remove or Add. .PARAMETER sProgramGuid Guid of the program whose software portal security is to be modified. .PARAMETER sPermissionGuid Permission...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/ScopingManagement.ps1
ScopingManagement.ps1
Function Set-ResourcesToOrganizationalGroup { <# .SYNOPSIS Assign one or more resource items to a Organizational Group .PARAMETER resourceItemGuids a comma-delimited string of GUIDs representing the resource items to be added .PARAMETER organizationalGroupGuid GUID of the Organizational Group .EXAMP...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SecurityManagement.ps1
SecurityManagement.ps1
Function Add-RoleMembers { <# .SYNOPSIS Add members to a security role. .PARAMETER roleGuid The guid of the role to add to. .PARAMETER memberNames A comma-seperated list of names to be added to the role. A name may be either (1) a fully qualified Windows credential name including both the domain and u...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwareComponentManagement.ps1
SoftwareComponentManagement.ps1
Function Add-AssociationToSoftwareComponent { <# .SYNOPSIS Associate an NS object with a software component. .PARAMETER ComponentGuid GUID of the software component .PARAMETER AssociatedResourceGuid GUID of the resource object that is to be associated with the Software Component .PARAMETER Associati...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SoftwareProductManagement.ps1
SoftwareProductManagement.ps1
Function New-SWProduct { <# .SYNOPSIS Method that creates a SoftwareProductResource. If an existing product that matches the Name and Company values given is found, a SoftwareProductDetails structure will be returned with the properties of the existing product. 'Description' parameter is ignored during finding ex...
PowerShellCorpus/PowerShellGallery/poshaltiris/0.0.3/Public/SWDSolnPackageManagement.ps1
SWDSolnPackageManagement.ps1
Function Add-SWDProgramToPackage { <# .SYNOPSIS Adds a Program Item to a Package. .PARAMETER sPackageGuid The Package to assign a program to. .PARAMETER sProgramGuid The Program to assign. .EXAMPLE CopyC# // See SWDSolnPackageManagementLib Overview for an example of setting up m_proxy. bool res...
PowerShellCorpus/PowerShellGallery/PSCoverage/0.1.39/Publish-CoverageReport.ps1
Publish-CoverageReport.ps1
Function Publish-CoverageReport () { <# .SYNOPSIS Uploads a given CoverageReport to coveralls.io. .DESCRIPTION .PARAMETER CoverageReport Provide a valid CoverageReport created by New-CoverageReport. .INPUTS [None] .OUTPUTS [Hashtable] .EXAM...
PowerShellCorpus/PowerShellGallery/PSCoverage/0.1.39/New-CoverageReport.ps1
New-CoverageReport.ps1
Function New-CoverageReport () { <# .SYNOPSIS Creates a new coverage report based on the given PesterFileMap. .DESCRIPTION New-CoverageReport runs all Pester tests listed in the PesterFileMap. Source files without pester test will be marked as uncovered. It returns...
PowerShellCorpus/PowerShellGallery/PSCoverage/0.1.39/New-PesterFileMap.ps1
New-PesterFileMap.ps1
Function New-PesterFileMap () { <# .SYNOPSIS Generates a new mapping between PowershellSource file <-> PesterTest file. .DESCRIPTION Pester Coverage function needs a 1:1 relationship between the source file and pester test file. Therefore we need this map to iterate through ...
PowerShellCorpus/PowerShellGallery/PSCoverage/0.1.39/Private/Get-GitInfo.ps1
Get-GitInfo.ps1
Function Get-GitInfo () { [CmdletBinding()] Param( [String]$BranchName ) If ($Env:AppVeyor) { Return [PSCustomObject]@{ head = [PSCustomObject]@{ id = $Env:APPVEYOR_REPO_COMMIT author_name = $Env:APPVEYOR_REPO_COMMIT_AUTHOR aut...
PowerShellCorpus/PowerShellGallery/PSCoverage/0.1.39/Init/Test-Requirements.ps1
Test-Requirements.ps1
Try { $GitVersion = $(git --version) } Catch { Write-Warning -Message @" It seems like you did not install a git client! You need a valid git setup to work with PSCoverage. Please install the git client and repeat try it again. Git Client Installation ----------------------- If you need help installi...
PowerShellCorpus/PowerShellGallery/PoSHive/1.4.3/PoSHive.ps1
PoSHive.ps1
Enum HeatingMode { <# Defines the heating modes that can be set. #> SCHEDULE MANUAL OFF } Enum ActivePlugMode { <# Defines the modes that can be set on an active plug. #> SCHEDULE MANUAL } Enum BoostTime { <# Defines accepted boost durations in hours. #> HALF ON...
PowerShellCorpus/PowerShellGallery/BE.ROXA.Exchange/1.3/init.ps1
init.ps1
# use this file to define global variables on module scope # or perform other initialization procedures. # this file will not be touched when new functions are exported to # this module.
PowerShellCorpus/PowerShellGallery/BE.ROXA.Exchange/1.3/Get-ExchangeUpdate.ps1
Get-ExchangeUpdate.ps1
function Get-ExchangeUpdate { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( # Specifies Version of Exchange [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $ExchangeVersion, ...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Examples/Config-SetupActiveDirectory.ps1
Config-SetupActiveDirectory.ps1
#region Param param ( [String]$DomainName, [String]$DomainNetbiosName, [PSCredential]$Credential, [PSCredential]$DomainCredential, [PSCredential]$SafeModeAdministratorPassword, [String]$EncryptionCertificateThumbprint ) #endregion #region Decrypt function De...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Unit/MSFT_xAdcsOnlineResponder.Tests.ps1
MSFT_xAdcsOnlineResponder.Tests.ps1
$script:DSCModuleName = 'xAdcsDeployment' $script:DSCResourceName = 'MSFT_xAdcsOnlineResponder' #region HEADER # Integration Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPat...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Unit/MSFT_xAdcsCertificationAuthority.Tests.ps1
MSFT_xAdcsCertificationAuthority.Tests.ps1
$script:DSCModuleName = 'xAdcsDeployment' $script:DSCResourceName = 'MSFT_xAdcsCertificationAuthority' #region HEADER # Integration Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -C...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Unit/MSFT_xAdcsWebEnrollment.Tests.ps1
MSFT_xAdcsWebEnrollment.Tests.ps1
$script:DSCModuleName = 'xAdcsDeployment' $script:DSCResourceName = 'MSFT_xAdcsWebEnrollment' #region HEADER # Integration Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath ...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Integration/MSFT_xAdcsCertificationAuthority.Tests.ps1
MSFT_xAdcsCertificationAuthority.Tests.ps1
# Suppress this PSSA message because we need to allow credentials to be # set when running the tests. [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () # IMPORTANT: To run these tests requires a local Administrator account to be # available ...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Integration/MSFT_xAdcsCertificationAuthority_Uninstall.config.ps1
MSFT_xAdcsCertificationAuthority_Uninstall.config.ps1
configuration MSFT_xADCSCertificationAuthority_Uninstall_Config { Import-DscResource -ModuleName xAdcsDeployment node localhost { xADCSCertificationAuthority Integration_Test { CAType = 'StandaloneRootCA' Credential = $Node.AdminCred Ensure = 'Absent' ...
PowerShellCorpus/PowerShellGallery/xAdcsDeployment/1.1.0.0/Tests/Integration/MSFT_xAdcsCertificationAuthority_Install.config.ps1
MSFT_xAdcsCertificationAuthority_Install.config.ps1
configuration MSFT_xADCSCertificationAuthority_Install_Config { Import-DscResource -ModuleName xAdcsDeployment node localhost { xADCSCertificationAuthority Integration_Test { CAType = 'StandaloneRootCA' Credential = $Node.AdminCred Ensure = 'Present' ...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrLeapYear2.ps1
Get-MrLeapYear2.ps1
#Requires -Version 3.0 function Get-MrLeapYear2 { <# .SYNOPSIS Get-MrLeapYear is used to determine whether or not a specific year is a leap year. .DESCRIPTION Get-MrLeapYear is a function that is used to determine whether or not the specified year(s) are leap years. Contrary to popular belief, leap ye...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Find-MrModuleUpdate.ps1
Find-MrModuleUpdate.ps1
#Requires -Version 3.0 -Modules PowerShellGet function Find-MrModuleUpdate { <# .SYNOPSIS Finds updates for installed modules from an online gallery that matches the specified criteria. .DESCRIPTION Find-MrModuleUpdate is a PowerShell advanced function that finds updates from an online gallery for lo...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrDayLightSavingTime.ps1
Get-MrDayLightSavingTime.ps1
#Requires -Version 3.0 function Get-MrDayLightSavingTime { <# .SYNOPSIS Returns the beginning and ending date for daylight saving time. .DESCRIPTION Get-MrDayLightSavingTime is a function that returns the dates when daylight saving time begins and ends for the specified year. .PARAMETER Year ...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/New-MrScriptModule.ps1
New-MrScriptModule.ps1
function New-MrScriptModule { <# .SYNOPSIS Creates a new PowerShell script module in the specified location. .DESCRIPTION New-MrScriptModule is an advanced function that creates a new PowerShell script module in the specified location including creating the module folder and both the PSM1 script ...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrAutoStoppedService.ps1
Get-MrAutoStoppedService.ps1
function Get-MrAutoStoppedService { <# .SYNOPSIS Returns a list of services that are set to start automatically, are not currently running, excluding the services that are set to delayed start. .DESCRIPTION Get-MrAutoStoppedService is a function that returns a list of services from the s...
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrGitHubRepositoryInfo.ps1
Get-MrGitHubRepositoryInfo.ps1
function Get-MrGitHubRepositoryInfo { [CmdletBinding()] [OutputType('Mr.RepositoryInfo')] param ( [Parameter(Mandatory)] [string[]]$UserName, [ValidateNotNullOrEmpty()] [string]$RepositoryName = '*' ) foreach ($User in $UserName) { Write-Verbos...