full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/HelloWorld-Event.ps1
HelloWorld-Event.ps1
Import-Module Cidney -Force Pipeline: HelloWorld { Stage: One { When: MyEvent1 { Write-Host 'HelloWorld from Stage One' } } Stage: Two { When: MyEvent2 { Write-Host 'HelloWorld from Stage Two' } } } -Verbose -Invoke Pipeline: H...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/HelloWorld-Parallel.ps1
HelloWorld-Parallel.ps1
Pipeline: HelloWorld { Stage: One { Do: { Write-Output '1. Hello World! from Stage One'; Sleep -Seconds 5} Do: { Write-Output '2. Hello World! from Stage One' } Do: { Write-Output '3. Hello World! from Stage One' } } Stage: Two { Do: { Find-Package *tfs* | Select-Obje...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/HelloWorld3.ps1
HelloWorld3.ps1
$newVar = 'ABC.3' Pipeline: 'HelloWorld 3' { $Test = 'ONE.3' Stage: 'One.3' { Write-Output "Hello World! from Stage $Stagename $Test $newVar" } }
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/HelloWorld-Parallel2.ps1
HelloWorld-Parallel2.ps1
Pipeline: HelloWorld { Stage: One { On: $env:COMPUTERNAME { Do: { Get-ChildItem C:\Windows\System32 | Where-Object Name -match '.dll' | Measure-Object } Do: GetService { Get-Service B* } } } } -Verbose -Invoke
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/remotetest.ps1
remotetest.ps1
Pipeline: RemoteTest { Stage: One { #On: Devops.hankeyinvestments.dev1, Devops.HankeyInvestments.dev2 { Do: { Get-Service Mic* } # } } } -Verbose -Invoke
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/HelloWorld-MultiStage.ps1
HelloWorld-MultiStage.ps1
Pipeline: HelloWorld { Stage: One { on: $env:COMPUTERNAME { Do: Hi {Write-Output 'Hello World! from Stage One'} } } Stage: Two { Write-Output 'Hello World! from Stage Two' } } -Verbose -Invoke
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Samples/SourceControlTest.ps1
SourceControlTest.ps1
Pipeline: FeedBack { Import-Module Cidney.Commands Register-PSSnapin Microsoft.TeamFoundation.Powershell Stage: Build { #Do: { Build -Path '$/Development/Feedback/Integration' -LocalPath D:\Prj\Feedback -SolutionName 'Feedback.sln' #} } Stage: Deploy { ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Keywords/Do.ps1
Do.ps1
function Do: { <# .SYNOPSIS Runs a scriptblock using Jobs. .DESCRIPTION A Cindey Pipeline: will run each Stage: one right after the other synchronously. Each Do: Block found will create a Job so they can be run asyncronously or in Parallel. Note: ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Keywords/On.ps1
On.ps1
function On: { <# .SYNOPSIS ON: command for Cidney Pipelines. Used between Stage: and Do: The ON: command lets you specify a computer(s) that you will run its script block against .DESCRIPTION ON: command for Cidney Pipelines. Used between Stage: and Do: ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Keywords/Stage.ps1
Stage.ps1
function Stage: { <# .SYNOPSIS Short Description .DESCRIPTION Detailed Description .EXAMPLE .\HelloWorld.ps1 Pipeline HelloWorld { Stage One { Do: { Get-Process } } } .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Keywords/Pipeline.ps1
Pipeline.ps1
function Pipeline: { <# .SYNOPSIS Cidney Pipeline: .DESCRIPTION Cidney Pipeline: .EXAMPLE .\HelloWorld.ps1 Pipeline HelloWorld { Stage One { Do: { Get-Process } } } .EXAM...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Keywords/When.ps1
When.ps1
function When: { <# .SYNOPSIS When: command for Cidney Pipelines. Used between Stage: and Do: The When: command lets you specify a an event to listen for that you will run its script block against .DESCRIPTION When: command for Cidney Pipelines. Used between...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/Stage.tests.ps1
Stage.tests.ps1
Import-Module Cidney -Force function ThrowError() { Throw 'Error' } #region Pipeline configurations Pipeline: '1 Stage' { Stage: 'Stage One' { Write-Output "$Stagename" } } Pipeline: '2 Stages' { Stage: 'Stage One' { Write-Output "$Stagename" } Stage: ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/Pipeline.Do.tests.ps1
Pipeline.Do.tests.ps1
#region Pipeline configurations Pipeline: 'Pipeline' { Do: { $Context.PipelineName } } Pipeline: 'Pipeline with Variables' { Do: { $A = 'A' Write-Output "$A" } } Pipeline: 'Pipeline with If (true)' { Do: { $A = 'A' if ($A -eq 'A') {...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/TestCidney.ps1
TestCidney.ps1
$path = 'c:\Program Files\WindowsPowershell\Modules\Cidney\' #$path = 'c:\Projects\Cidney\' Import-module (Join-path $path 'Cidney.psd1') pipeline: CidneyBuild { $base = (Get-Module Cidney).ModuleBase Import-Module Pester Stage: Pester { Do: { Invoke-Pester -Script "$base\Tests\Pipeline.Tests...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/EmbeddedPipelineScript.ps1
EmbeddedPipelineScript.ps1
Pipeline: 'PipelineEmbedded' { Write-Output "$PipelineName" } -Invoke
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/On.tests.ps1
On.tests.ps1
#region On configurations Pipeline: 'On Test with Stage' { Stage: 'Stage One' { On: localhost { Do: { Write-Output $env:COMPUTERNAME } } } } Pipeline: 'On Test with without Stage' { On: localhost { Do: { Write-Output $env:COMPUTERNAME } } } Pi...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/Performance.Tests.ps1
Performance.Tests.ps1
#region Pipeline configurations Pipeline: 'Do baseline' { Stage: One: { Do: {} } } Pipeline: 'Do baseline 16' { Stage: One: { foreach ($num in 1..16) { Do: {} -Context $Context } } } Pipeline: 'Do Timing 16 threads' { Stage: One: { ...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/Do.Tests.ps1
Do.Tests.ps1
#region Pipeline configurations Pipeline: 'Do Global Variable' { Stage: One { Do: { Write-Output $ABC } } } Pipeline: 'Do Local Variable in Pipeline' { $Abc = 'abc' Stage: One { Do: { Write-Output $ABC } } } Pipeline: 'Do Local Variable in Stage' { Stage: On...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/When.tests.ps1
When.tests.ps1
#region When configurations Pipeline: 'When with Stage' { Stage: 'Stage One' { When: Event1 { Write-output 'Stage One' } } Stage: 'Stage Two' { Send-Event Event1 } } Pipeline: 'When trigger from another pipeline' { Stage: 'Stage One' { W...
PowerShellCorpus/PowerShellGallery/Cidney/1.0.0.7/Tests/Pipeline.tests.ps1
Pipeline.tests.ps1
#region Pipeline configurations Pipeline: 'Pipeline' { Write-Output "$PipelineName" } Pipeline: 'Pipeline With Params provided' { param([string]$TestParam, [int32]$TestParam2) Write-Output "$TestParam" Write-Output "$TestParam2" } Pipeline: 'Pipeline With Params Embedded' { par...
PowerShellCorpus/PowerShellGallery/PSAzureQueue/0.3.2/Publish-Module.ps1
Publish-Module.ps1
Import-Module -Name $PSScriptRoot\PSAzureQueue.psd1; $NuGetApiKey = ConvertTo-SecureString -String (Get-Content -Path "$env:USERPROFILE\NuGetApiKey.json"); $NuGetCredential = New-Object -TypeName PSCredential -ArgumentList @('username', $NuGetApiKey); Publish-Module -Name $PSScriptRoot\PSAzureQueue.psd1 -NuGetApiKey...
PowerShellCorpus/PowerShellGallery/PSAzureQueue/0.3.2/Samples/Example 01.ps1
Example 01.ps1
<######################################################## Author: Trevor Sullivan <trevor@trevorsullivan.net> Website: https://trevorsullivan.net Twitter: https://twitter.com/pgeek86 ########################################################> #region Setup ### Import the PSAzureQueue module # Imp...
PowerShellCorpus/PowerShellGallery/Intigua/1.0.0.12/Examples/ForAzureAutomation/IEM.ps1
IEM.ps1
configuration IEM { Import-DscResource -ModuleName Intigua Node IEMAbsent { Agent IEM { AgentPath = "https://intiguadsc.blob.core.windows.net/agents/iem_lw_Windows_x64_9.1_2.9.0.378.vai" AgentName = "iem" AgentParameters = @{ACT...
PowerShellCorpus/PowerShellGallery/Intigua/1.0.0.12/Examples/ForAzureAutomation/ConnectorAndIEM.ps1
ConnectorAndIEM.ps1
configuration IntiguaWithIEM { Import-DscResource -ModuleName Intigua Node IntiguaWithIEM { Connector InstallConnector { ConnectorVersion = "3.4.0.24" CoreServerUrl = "http://172.16.1.88:8080/vmanage-server/" Ensure = "Present" } ...
PowerShellCorpus/PowerShellGallery/Intigua/1.0.0.12/Examples/Tests/Sample_IntiguaWithIEM.ps1
Sample_IntiguaWithIEM.ps1
configuration Sample_IntiguaWithIEM { Import-DscResource -ModuleName Intigua Node localhost { Connector InstallConnector { ConnectorVersion = "3.4.0.24" CoreServerUrl = "http://172.16.1.88:8080/vmanage-server/" Ensure = "Present" } ...
PowerShellCorpus/PowerShellGallery/Intigua/1.0.0.12/Examples/Tests/Sample_RemoveIntigua.ps1
Sample_RemoveIntigua.ps1
configuration Sample_RemoveIntigua { Import-DscResource -ModuleName Intigua Node localhost { Connector InstallConnector { ConnectorVersion = "3.4.0.24" CoreServerUrl = "http://172.16.1.88:8080/vmanage-server/" Ensure = "Absent" ...
PowerShellCorpus/PowerShellGallery/Pinvoke/1.0.4/CreateModuleManifest.ps1
CreateModuleManifest.ps1
$FunctionsToExport = @( 'Find-PinvokeSignature', 'Get-PinvokeSignature', 'New-PinvokeCommand') $NewModuleManifestParams = @{ ModuleVersion = $ENV:APPVEYOR_BUILD_VERSION Path = (Join-Path $PSScriptRoot '.\PInvoke.psd1') Author = 'Adam Driscoll' Company = 'Adam Driscoll' Description = 'PowerShell module accessing t...
PowerShellCorpus/PowerShellGallery/Pinvoke/1.0.4/Pinvoke.tests.ps1
Pinvoke.tests.ps1
if ($ENV:APPVEYOR -ne 'true') { $ENV:APPVEYOR_BUILD_VERSION = '99.99' . (Join-Path $PSScriptRoot 'CreateModuleManifest.ps1') } Import-Module (Join-Path $PSScriptRoot 'PInvoke.psd1') -Force Describe "New-PinvokeCommand" { Context "Create a command for Beep" { It "Returns true" { New-PinvokeCommand -Module Ker...
PowerShellCorpus/PowerShellGallery/Pinvoke/1.0.4/PublishModule.ps1
PublishModule.ps1
if ($env:APPVEYOR_REPO_BRANCH -eq 'master'-and $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null) { choco install NuGet.CommandLine Install-PackageProvider -Name NuGet -Force Publish-Module -NuGetApiKey $env:ApiKey -Path C:\Pinvoke -Confirm:$False -Verbose }
PowerShellCorpus/PowerShellGallery/Pinvoke/1.0.4/InvokeTests.ps1
InvokeTests.ps1
if ($PSVersionTable.PSVersion.Major -ge 5) { Write-Verbose -Verbose "Installing PSScriptAnalyzer" $PSScriptAnalyzerModuleName = "PSScriptAnalyzer" Install-PackageProvider -Name NuGet -Force Install-Module -Name $PSScriptAnalyzerModuleName -Scope CurrentUser -Force $PSScriptAnalyzerModule = get-mod...
PowerShellCorpus/PowerShellGallery/AzureRM.Websites/3.1.0/ResourceManagerStartup.ps1
ResourceManagerStartup.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
PowerShellCorpus/PowerShellGallery/AzureRM.Websites/3.1.0/WebsitesStartup.ps1
WebsitesStartup.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
PowerShellCorpus/PowerShellGallery/AzureRM.Websites/2.8.0/ResourceManagerStartup.ps1
ResourceManagerStartup.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
PowerShellCorpus/PowerShellGallery/AzureRM.Websites/2.8.0/WebsitesStartup.ps1
WebsitesStartup.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
PowerShellCorpus/PowerShellGallery/PSvCloud/0.0.5/Private/Test-CIConnection.ps1
Test-CIConnection.ps1
function Test-CIConnection { <# .SYNOPSIS Tests for a connected vCloud session. .DESCRIPTION Tests for a single connected vCloud session. .PARAMETER DefaultCIServers All current vCloud connections from Global scope. .EXAMPLE Test-CIConnection .NOTES Author:...
PowerShellCorpus/PowerShellGallery/PSvCloud/0.0.5/Public/Edge/Get-CIEdgeView.ps1
Get-CIEdgeView.ps1
function Get-CIEdgeView { <# .SYNOPSIS Gets the Edge View. .DESCRIPTION Gets the Edge View using the Search-Cloud cmdlet. .PARAMETER Name Specifies a single vShield Edge name. .INPUTS System.String .OUTPUTS VMware.VimAutomation.Cloud.Views.Gateway .E...
PowerShellCorpus/PowerShellGallery/PSvCloud/0.0.5/Public/Edge/Get-CIEdgeXML.ps1
Get-CIEdgeXML.ps1
function Get-CIEdgeXML { <# .SYNOPSIS Gets the vCloud Edge configuration XML. .DESCRIPTION Gets the vCloud Edge configuration XML using the REST API. .PARAMETER CIEdgeView CIEdgeView object for SessionKey and Name properties. .INPUTS VMware.VimAutomation.Cloud.Views.Ga...
PowerShellCorpus/PowerShellGallery/PSvCloud/0.0.5/Public/Edge/Get-CIEdge.ps1
Get-CIEdge.ps1
function Get-CIEdge { <# .SYNOPSIS Retrieves vCloud Edges. .DESCRIPTION Retrieves vCloud Edges, including View and XML configuration. .PARAMETER Name Specifies the name of the vShield Edge you want to retrieve. .INPUTS System.String .OUTPUTS System.Manageme...
PowerShellCorpus/PowerShellGallery/AutomatedLabDefinition/3.9.0.5/AutomatedLabDefinition.init.ps1
AutomatedLabDefinition.init.ps1
Add-Type -Path $PSScriptRoot\..\AutomatedLab\AutomatedLab.dll
PowerShellCorpus/PowerShellGallery/WmiNamespaceSecurity/0.1.0/WmiNamespaceSecurity.Tests.ps1
WmiNamespaceSecurity.Tests.ps1
$nsname = "WmiNamespaceTest" $nspath = "root\$nsname" $testuser = "WmiNamespaceUser" $testuserPassword = "Pa55w0rd!!" $principal = New-Object Security.Principal.WindowsPrincipal -ArgumentList ([Security.Principal.WindowsIdentity]::GetCurrent()) if (!$principal.IsInRole( [Security.Principal.WindowsBuiltInRole]::A...
PowerShellCorpus/PowerShellGallery/AMSI/1.0.9/CreateModuleManifest.ps1
CreateModuleManifest.ps1
$FunctionsToExport = @( 'Initialize-Amsi', 'Uninitialize-Amsi', 'New-AmsiSession', 'Remove-AmsiSession', 'Test-AmsiString') $NewModuleManifestParams = @{ ModuleVersion = $ENV:APPVEYOR_BUILD_VERSION Path = (Join-Path $PSScriptRoot '.\AMSI.psd1') Author = 'Adam Driscoll' Company = 'Adam Driscoll' Description = 'Pow...
PowerShellCorpus/PowerShellGallery/AMSI/1.0.9/AMSI.tests.ps1
AMSI.tests.ps1
if ($ENV:AppVEYOR -eq 'true') { Write-Warning "Unable to run these tests on AppVeyor since these tests require Windows 10 or Windows Server 2016." return } $ENV:APPVEYOR_BUILD_VERSION = '99.99' . (Join-Path $PSScriptRoot 'CreateModuleManifest.ps1') $ModulePath = Join-Path $PSScriptRoot 'AMSI.psd1' Import-Module $Mo...
PowerShellCorpus/PowerShellGallery/AMSI/1.0.9/PublishModule.ps1
PublishModule.ps1
if ($env:APPVEYOR_REPO_BRANCH -eq 'master'-and $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null) { choco install NuGet.CommandLine Install-PackageProvider -Name NuGet -Force Publish-Module -NuGetApiKey $env:ApiKey -Path C:\AMSI -Confirm:$False -Verbose }
PowerShellCorpus/PowerShellGallery/AMSI/1.0.9/InvokeTests.ps1
InvokeTests.ps1
if ($PSVersionTable.PSVersion.Major -ge 5) { Write-Verbose -Verbose "Installing PSScriptAnalyzer" $PSScriptAnalyzerModuleName = "PSScriptAnalyzer" Install-PackageProvider -Name NuGet -Force Install-Module -Name $PSScriptAnalyzerModuleName -Scope CurrentUser -Force $PSScriptAnalyzerModule = get-mod...
PowerShellCorpus/PowerShellGallery/xJea/0.2.16.6/Examples/Demo1.ps1
Demo1.ps1
cls configuration Demo1 { Import-DscResource -module xjea xJeaToolKit Process { Name = 'Process' CommandSpecs = @" Name,Parameter,ValidateSet,ValidatePattern Get-Process Get-Service Stop-Process,Name,calc;notepad Restart-Service,Name,,^A "@ } xJeaEndPoint D...
PowerShellCorpus/PowerShellGallery/xJea/0.2.16.6/Examples/SetupJea.ps1
SetupJea.ps1
Configuration SetupJea { Import-DscResource -module xjea Node localhost { xJeaEndPoint CleanAll { Name = 'CleanALL' CleanAll = $true } LocalConfigurationManager { RefreshFrequencyMins = 30 Configuratio...
PowerShellCorpus/PowerShellGallery/xJea/0.2.16.6/Examples/Demo2.ps1
Demo2.ps1
cls configuration Demo2 { Import-DscResource -module xjea xJeaToolKit SMBGet { Name = 'SMBGet' CommandSpecs = @" Module,Name,Parameter,ValidateSet,ValidatePattern SMBShare,get-* "@ } xJeaEndPoint Demo2EP { Name = 'Demo2EP' ...
PowerShellCorpus/PowerShellGallery/xJea/0.2.16.6/Examples/Demo3.ps1
Demo3.ps1
cls configuration Demo3 { Import-DscResource -module xjea xJeaToolKit FileSystem { Name = 'FileSystem' CommandSpecs = @" Module,name,Parameter,ValidateSet,ValidatePattern ,Get-ChildItem ,Get-Item ,Copy-Item ,Move-Item ,Rename-Item ,Remove-Item ,Copy-ItemProperty ,Clea...
PowerShellCorpus/PowerShellGallery/xJea/0.2.16.6/Util/Initialize-ToolKit.ps1
Initialize-ToolKit.ps1
# Copyright © 2014, Microsoft Corporation. All rights reserved. #InitializeToolKit param( [ValidateNotNullOrEmpty()] $ToolkitName ) ipmo (Join-Path $env:ProgramFiles 'Jea\Util\SafeProxy.psm1') -DisableNameChecking $winrm = Get-Service WinRM function Write-ActivityRecord { $JeaDir = Joi...
PowerShellCorpus/PowerShellGallery/Proxx.Toast/0.1.2/Test.ps1
Test.ps1
ipmo -Verbose Proxx.Toast -Force Show-WinToast -Title "Windows PowerShell" Show-WinToast -Title "Windows PowerShell" -Message "Lorem ipsum dolor sit amet." Show-WinToast -Title "Windows PowerShell" -Image "$PSScriptRoot\ps.png" Show-WinToast -Title "Windows PowerShell" -Image "$PSScriptRoot\ps.png" -Message "Lor...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/private/Add.ps1
Add.ps1
function Add() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $name, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $desc, [Parameter(Mandatory=$true, Position=2, valuefromPipeline=$true)] [string...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Get-NessusPolicies.ps1
Get-NessusPolicies.ps1
function Get-NessusPolicies{ $pols = @{} $resp = Send-NessusRequest "Get" "/editor/policy/templates" foreach ($pol in $resp.templates) { $pols.Add($pol.title, $pol.uuid) } return $pols }
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Connect-Nessus.ps1
Connect-Nessus.ps1
function Connect-Nessus() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $username, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $password ) $data = @{"username" = $username; "password" = $password} $resp = ...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Start-NessusScan.ps1
Start-NessusScan.ps1
function Start-NessusScan() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid ) $resp = Send-NessusRequest "Post" "/scans/$sid/launch" return $resp.scan_uuid }
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Disconnect-Nessus.ps1
Disconnect-Nessus.ps1
function Disconnect-Nessus{ $resp = Send-NessusRequest "Delete" "/session" $resp }
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Get-NessusScans.ps1
Get-NessusScans.ps1
function Get-NessusScans { $scans = @() $resp = Send-NessusRequest "Get" "/scans" foreach ($scan in $resp.scans){ $scans += [pscustomobject]@{ id = $scan.id name = $scan.name starttime = $scan.starttime } } $scans }
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Get-NessusHistoryIds.ps1
Get-NessusHistoryIds.ps1
function Get-NessusHistoryIds() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid ) #$hids = @() $resp = Send-NessusRequest "Get" "/scans/$sid" foreach ($hist in $resp.history) { [pscustomobject]@{ uuid = $hist.uuid ...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Get-NessusScanHistory.ps1
Get-NessusScanHistory.ps1
function Get-NessusScanHistory() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $hid ) $data = @{"history_id" = $hid} $resp = Send-NessusRequest "GET" "/sca...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Export-NessusStatus.ps1
Export-NessusStatus.ps1
function Export-NessusStatus() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $fid ) $resp = Send-NessusRequest "Get" "/scans/$sid/export/$fid/status" ret...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Get-NessusExportFile.ps1
Get-NessusExportFile.ps1
function Get-NessusExportFile() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $fid ) $resp = Send-NessusRequest "Get" "/scans/$sid/export/$fid/download" ...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Send-NessusRequest.ps1
Send-NessusRequest.ps1
Set-StrictMode -Version latest function Send-NessusRequest() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $method, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $resource, [Parameter(Mandatory=$false,...
PowerShellCorpus/PowerShellGallery/PSNessus/1.0.3.0/public/Export-NessusHistory.ps1
Export-NessusHistory.ps1
function Export-NessusHistory() { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, valuefromPipeline=$true)] [string] $sid, [Parameter(Mandatory=$true, Position=1, valuefromPipeline=$true)] [string] $hid ) $data = @{} $data.Add("history_id", $hid) $data.Add("format", "nessu...
PowerShellCorpus/PowerShellGallery/FreeLDAP/1.0.0.0/Get-LdapUser.ps1
Get-LdapUser.ps1
Function Get-LdapUser { <# .SYNOPSIS Search for User objects in an LDAP directory. .DESCRIPTION Uses the System.DirectoryServices Assembly to search for User objects in a Non-Microsoft LDAP directory. .PARAMETER Name SamAccount or Part of the CN Name to search for...
PowerShellCorpus/PowerShellGallery/FreeLDAP/1.0.0.0/Move-LdapUser.ps1
Move-LdapUser.ps1
Function Move-LdapUser { <# .SYNOPSIS Search for User objects in an LDAP directory. .DESCRIPTION Uses the System.DirectoryServices Assembly to move objects in a Non-Microsoft LDAP directory. .PARAMETER Name SamAccount or Part of the CN Name to search for.. ...
PowerShellCorpus/PowerShellGallery/FreeLDAP/1.0.0.0/Set-LdapUserRemaining.ps1
Set-LdapUserRemaining.ps1
Function Set-LdapUser { <# .SYNOPSIS Set attributes on an LDAP user. .DESCRIPTION Uses the System.DirectoryServices Assembly to Set attributes on an LDAP user object in a Non-Microsoft LDAP directory. .PARAMETER DistinguishedName The distinguished name that will h...
PowerShellCorpus/PowerShellGallery/FreeLDAP/1.0.0.0/Set-LdapUser.ps1
Set-LdapUser.ps1
Function Set-LdapUser { <# .SYNOPSIS Set attributes on an LDAP user. .DESCRIPTION Uses the System.DirectoryServices Assembly to Set attributes on an LDAP user object in a Non-Microsoft LDAP directory. .PARAMETER DistinguishedName The distinguished name that will h...
PowerShellCorpus/PowerShellGallery/FreeLDAP/1.0.0.0/Connect-LdapServer.ps1
Connect-LdapServer.ps1
Function Connect-LdapServer { <# .SYNOPSIS Connect to an LDAP server. .DESCRIPTION Bind to an LDAP server on port 389 using Dot NET class System.DirectoryServices.Protocols and save the connection to the global variable LdapConnection .PARAMETER Server D...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/New-PssModuleProject.ps1
New-PssModuleProject.ps1
function New-PssModuleProject { <# .SYNOPSIS Builds a Sapien PowerShell Studio Module Project from a regular module. .DESCRIPTION Builds a Sapien PowerShell Studio Module Project, either a clean one, or imports from a regular module. Will ignore a...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Measure-CommandEx.ps1
Measure-CommandEx.ps1
function Measure-CommandEx { <# .SYNOPSIS Measures command performance with consecutive tests. .DESCRIPTION This function measures the performance of a scriptblock many consective times. Warning: Running a command repeatedly may not yield reliable information, since repeated executions ma...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Set-ModuleDebug.ps1
Set-ModuleDebug.ps1
function Set-ModuleDebug { <# .SYNOPSIS Configures how modules are handled during import of this module. .DESCRIPTION This module allows specifying other modules to import during import of this module. Using the Set-ModuleDebug function it is possible to configure, which module is automatically...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Restart-Shell.ps1
Restart-Shell.ps1
function Restart-Shell { <# .SYNOPSIS A swift way to restart the PowerShell console. .DESCRIPTION A swift way to restart the PowerShell console. - Allows increasing elevation - Allows keeping the current process, thus in effect adding...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Remove-ModuleDebug.ps1
Remove-ModuleDebug.ps1
function Remove-ModuleDebug { <# .SYNOPSIS Removes module debugging configurations. .DESCRIPTION Removes module debugging configurations. .PARAMETER Name Name of modules whose debugging configuration should be removed. .EXAMPLE PS C:\> Remove-ModuleDebug -Name "cPSNetwork" ...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Get-HelpEx.ps1
Get-HelpEx.ps1
Function Get-HelpEx { <# .SYNOPSIS Displays localized information about Windows PowerShell commands and concepts. .DESCRIPTION The Get-HelpEx function is a wrapper around get-help that allows localizing help queries. This is especially useful when developing modules with help in multiple languag...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Import-ModuleDebug.ps1
Import-ModuleDebug.ps1
function Import-ModuleDebug { <# .SYNOPSIS Invokes the preconfigured import of a module. .DESCRIPTION Invokes the preconfigured import of a module. .PARAMETER Name The exact name of the module to import using the specified configuration. .EXAMPLE PS C:\> Import-ModuleDebug -Na...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/functions/Get-ModuleDebug.ps1
Get-ModuleDebug.ps1
function Get-ModuleDebug { <# .SYNOPSIS Retrieves module debugging configurations .DESCRIPTION Retrieves a list of all matching module debugging configurations. .PARAMETER Filter Default: "*" A string filter applied to the module name. All modules of matching name (using a -Like comp...
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/scripts/postload.ps1
postload.ps1
$__modules = Get-ModuleDebug | Sort-Object Priority foreach ($__module in $__modules) { if ($__module.AutoImport) { try { . Import-ModuleDebug -Name $__module.Name -ErrorAction Stop } catch { Write-Warning "Failed to import Module: $($__module.Name)" } } }
PowerShellCorpus/PowerShellGallery/PSModuleDevelopment/1.3.1.17/scripts/preload.ps1
preload.ps1
#region Ensure Config path exists # If there is no global override for the config path, use module default path # Note: Generally, you shouldn't enforce checking on the global scope for variables. Since importing modules however is a global action, this is an exception if (-not ($global:PSModuleDevelopment_ModuleC...
PowerShellCorpus/PowerShellGallery/NtpTime/1.1/PublishPsGalleryModule.ps1
PublishPsGalleryModule.ps1
#requires -Modules PowerShellGet $ReleaseNotes =@' Get-NtpTime Chris Warwick, @cjwarwickps, September 2015. v1.1 release to the PowerShell Gallery. This module contains a single PS Function 'Get-NtpTime' which sends an NTP request to a specified NTP server and decodes the returned raw NTP packet. The function will...
PowerShellCorpus/PowerShellGallery/Test-Expression/2.4.0/Tests/Test-Expression.Tests.ps1
Test-Expression.Tests.ps1
#pester tests for Test-Expression Import-Module ..\Test-Expression -force InModuleScope Test-Expression { Describe "Test-Expression" { It "Should have an alias" { (Get-Alias tex).ResolvedCommand.Name | Should Be "Test-Expression" } It "Should do a single test" { $result = ...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/TortoiseGit.ps1
TortoiseGit.ps1
# TortoiseGit function private:Get-TortoiseGitPath { if ((Test-Path "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe") -eq $true) { # TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc. return "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe" } return "C:\Program F...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/CheckVersion.ps1
CheckVersion.ps1
$Global:GitMissing = $false if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) { Write-Warning "git command could not be found. Please create an alias or add it to your PATH." $Global:GitMissing = $true return } $requiredVersion = [Version]'1.7.2' if ([String](git --version 2> $n...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/Utils.ps1
Utils.ps1
# Need this variable as long as we support PS v2 $ModuleBasePath = Split-Path $MyInvocation.MyCommand.Path -Parent # Store error records generated by stderr output when invoking an executable # This can be accessed from the user's session by executing: # PS> $m = Get-Module posh-git # PS> & $m Get-Variable invok...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/GitPrompt.ps1
GitPrompt.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration $global:GitPromptSettings = [pscustomobject]@{ DefaultForegroundColor = $null BeforeText = ' [' BeforeForegroundColor ...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/GitUtils.ps1
GitUtils.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration <# .SYNOPSIS Gets the path to the current repository's .git dir. .DESCRIPTION Gets the path to the current repository's .git dir. Or if the repository is a bare repository, the root direct...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/GitParamTabExpansion.ps1
GitParamTabExpansion.ps1
# Variable is used in GitTabExpansion.ps1 $shortGitParams = @{ add = 'n v f i p e u A N' bisect = '' blame = 'b L l t S p M C h c f n s e w' branch = 'd D l f m M r a v vv q t u' checkout = 'q f b B t l m p' cherry = 'v' 'cherry-pick' = 'e x r m n s S X' clean = 'd f i n q e x X...
PowerShellCorpus/PowerShellGallery/posh-git/0.7.1/GitTabExpansion.ps1
GitTabExpansion.ps1
# Initial implementation by Jeremy Skinner # http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/ $Global:GitTabSettings = New-Object PSObject -Property @{ AllCommands = $false } $subcommands = @{ bisect = 'start bad good skip reset visualize replay log run' notes = 'edit ...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Private/Join-Parts.ps1
Join-Parts.ps1
function Join-Parts { <# .SYNOPSIS Join strings with a specified separator. .DESCRIPTION Join strings with a specified separator. This strips out null values and any duplicate separator characters. See examples for clarification. .PARAMETER Separator ...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Private/ConvertFrom-RTResponse.ps1
ConvertFrom-RTResponse.ps1
function ConvertFrom-RTResponse { [cmdletbinding()] param( [string]$Content ) $ContentArray = $Content -split "`n" $Count = $ContentArray.Count $Output = [ordered]@{} $Name = $null $Value = $null for ($linenumber = 0; $linenumber -lt $Count; $linenumber++) { ...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/New-RTSession.ps1
New-RTSession.ps1
function New-RTSession { <# .Synopsis Connects to RT Server and returns a Session. .DESCRIPTION Connects to RT Server and returns a Session So that other PSRT commands can be authenticated when using the -Session paramenter Session is automatically added to PSRTConfig .PAR...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/Get-RTConfig.ps1
Get-RTConfig.ps1
Function Get-RTConfig { <# .SYNOPSIS Get PSRT module configuration. .DESCRIPTION Get PSRT module configuration .PARAMETER Source Get the config data from either... Variable: the live module variable used for command defaults Path: ...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/Set-RTConfig.ps1
Set-RTConfig.ps1
function Set-RTConfig { <# .SYNOPSIS Set Request Tracker module configuration. .DESCRIPTION Set Request Tracker module configuration, and live $PSRTConfig module variable This data is used as the default for most commands. .PARAMETER BaseUri ...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/Find-RTTicket.ps1
Find-RTTicket.ps1
Function Find-RTTicket { <# .SYNOPSIS Find RT tickets with a specified query .DESCRIPTION Find RT tickets with a specified query .PARAMETER Query Query string to pass to RT Details: https://rt-wiki.bestpractical.com/wiki/REST#Ticket_Search .PARAMETER Expand...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/Get-RTTicket.ps1
Get-RTTicket.ps1
Function Get-RTTicket { <# .SYNOPSIS GET RT Ticket overview .DESCRIPTION GET RT Ticket overview .PARAMETER Ticket Ticket to query .PARAMETER Session RT session to use. Defaults to PSRTConfig.Session (Created by New-RTSession) .PARAMETER BaseUri Base URI for RT. Defaults to PSRTConfig.Ba...
PowerShellCorpus/PowerShellGallery/PSRT/0.0.2/Public/Get-RTTicketEntry.ps1
Get-RTTicketEntry.ps1
Function Get-RTTicketEntry { <# .SYNOPSIS GET RT ticket history entry .DESCRIPTION GET RT ticket history entry. If an entry is not specified, we list the RT ticket history .PARAMETER Ticket Ticket to query .PARAMETER Entry Optional entry to query for. If not specified, we list all entry numbe...
PowerShellCorpus/PowerShellGallery/AWSPowerShell.NetCore/3.3.104.0/AWSAliases.ps1
AWSAliases.ps1
Set-Alias -Name AG-TestInvokeAuthorizer -Value Test-AGInvokeAuthorizer Set-Alias -Name AG-TestInvokeMethod -Value Test-AGInvokeMethod Set-Alias -Name AG-UpdateAccount -Value Update-AGAccount Set-Alias -Name AG-UpdateApiKey -Value Update-AGApiKey Set-Alias -Name AG-UpdateAuthorizer -Value Update-AGAuthorizer Set-Al...
PowerShellCorpus/PowerShellGallery/TrellOps/1.0.1.24/Functions/Get-Attachment/Get-Attachment.ps1
Get-Attachment.ps1
function Get-Attachment { <# .Synopsis Gets a Trello Checklists Item. .Description Adds a Trello Checklists Item. #> [cmdletbinding(DefaultParameterSetName="All")] param( [parameter( Mandatory=$true, Position=0 )] ...
PowerShellCorpus/PowerShellGallery/TrellOps/1.0.1.24/Functions/Remove-Label/Remove-Label.ps1
Remove-Label.ps1
function Remove-Label { <# .Synopsis Removes a Trello Label. .Description Removes a Trello Label. #> [cmdletbinding()] param ( [parameter( Mandatory=$true, Position=0 )] $Token, [parameter( Man...
PowerShellCorpus/PowerShellGallery/TrellOps/1.0.1.24/Functions/Get-Card/Get-Card.ps1
Get-Card.ps1
function Get-Card { <# .Synopsis Gets all cards on a Trello board. .Description Gets all cards on a Trello board. #> [CmdletBinding(DefaultParameterSetName="All")] param( [parameter( Mandatory=$true, Position=0 )] $...
PowerShellCorpus/PowerShellGallery/TrellOps/1.0.1.24/Functions/Add-ChecklistItem/Add-ChecklistItem.ps1
Add-ChecklistItem.ps1
function Add-ChecklistItem { <# .Synopsis Adds a new Item to a Trello Checklists. .Description Adds a new Item to a Trello Checklists. #> [cmdletbinding()] param( [parameter( Mandatory=$true, Position=0 )] $Token, ...