full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Measure-Correlation.ps1 | Measure-Correlation.ps1 | function Measure-Correlation
{
<#
.Synopsis
Measures the correlation coeffecients in a set of data
.Description
Determines the correlation coeffecients in a set of data
#>
param(
# The input object
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[PSO... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/ConvertTo-Celsius.ps1 | ConvertTo-Celsius.ps1 | function ConvertTo-Celsius
{
<#
.Synopsis
Converts fahrenheit to celsius
.Description
Converts degrees in fahrenheit to celsius
.Example
ConvertTo-Celsius 32
#>
[OutputType([Double])]
param(
# The temperature, in fahrenheit
[Parameter(Mandator... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-Angle.ps1 | Get-Angle.ps1 | function Get-Angle
{
<#
.Synopsis
Calculates an angle
.Description
Gets the angle of a given slope, given rise over run
#>
param(
# The rise of the slope
[Parameter(Mandatory=$true,Position=0)]
[Double]
$Rise,
# The run of the slope
[Parameter(... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Measure-Mass.ps1 | Measure-Mass.ps1 | function Measure-Mass
{
<#
.Synopsis
Calculates the mass of an object.
.Description
Calculates the mass of an object, using the equation
Mass = Density * Volume
#>
[CmdletBinding(DefaultParameterSetName='ASideBSide')]
param(
# The Density of the O... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/ConvertTo-Metric.ps1 | ConvertTo-Metric.ps1 | function ConvertTo-Metric
{
<#
.Synopsis
Converts units from imperial to metric
.Description
Converts a variety of units from imperial to metric
.Example
ConvertTo-Metric 1 pound
#>
[OutputType([PSObject])]
param(
# The value to convert into metric... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/ConvertTo-Fahrenheit.ps1 | ConvertTo-Fahrenheit.ps1 | function ConvertTo-Fahrenheit
{
<#
.Synopsis
Converts celsius to fahrenheit
.Description
Converts degrees in celsius to fahrenheit
.Example
ConvertTo-Fahrenheit 233
#>
[OutputType([Double])]
param(
# The temperature, in celsius
[Parameter(Mandator... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-Average.ps1 | Get-Average.ps1 | None |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-EllipseArea.ps1 | Get-EllipseArea.ps1 | function Get-EllipseArea
{
<#
.Synopsis
Gets the area of an ellipse
.Description
Gets the area of an ellipse, using the simple equation
Area = Pi * Radius1 * Radius2
#>
[CmdletBinding(DefaultParameterSetName='Radius')]
param(
# The radius
... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-TrapezoidArea.ps1 | Get-TrapezoidArea.ps1 | function Get-TrapezoidArea
{
<#
.Synopsis
Gets the area of a Trapezoid
.Description
Gets the area of a Trapezoid, using the simple equation
Area = h/2 * (b1 + b2)
#>
[CmdletBinding(DefaultParameterSetName='HeightOverTwoTimesBaseTotal')]
param(
# ... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-StandardDeviation.ps1 | Get-StandardDeviation.ps1 | ïŧŋfunction Get-StandardDeviation
{
<#
.Synopsis
Gets the standard deviation of a series of numbers
.Description
Gets the standard deviation of a series of numbers
.Example
Get-StandardDeviation 2,4,6,8
#>
param(
# The series of numbers
[Parameter(Man... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-TriangleSide.ps1 | Get-TriangleSide.ps1 | function Get-TriangleSide
{
<#
.Synopsis
Gets the sides of a triangle
.Description
Gets the sides of a triangle, using the law of Pythagoras:
a^2 + b^2 = c^2
#>
[CmdletBinding(DefaultParameterSetName='ASideBSide')]
param(
# The Length of Side A
... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Formulaic.ezformat.ps1 | Formulaic.ezformat.ps1 | $moduleRoot = "$home\documents\windowspowershell\modules\Formulaic"
# Get-Module Pipeworks | Split-Path
$formatViews = @()
$formatViews +=
Write-FormatView -TypeName formulaic.flashcard -Action {
$flashcard = $_
$nextUrl = "$($fullUrl)"
if ($nextUrl -like "*Get-Flashcard_GradeLe... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-RandomFlashcard.ps1 | Get-RandomFlashcard.ps1 | function Get-RandomFlashcard
{
<#
.Synopsis
Gets a random flashcard
.Description
Gets a random flashcard for grades 1-4
#>
param(
)
$gradeLevel = '1st', '2nd', '3rd', '4th' | Get-Random
Get-Flashcard -GradeLevel $gradeLevel
}
|
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-SquareArea.ps1 | Get-SquareArea.ps1 | function Get-SquareArea
{
<#
.Synopsis
Gets the area of a square
.Description
Gets the area of a square, using the simple equation
Area = side^2
#>
[CmdletBinding(DefaultParameterSetName='ASideBSide')]
param(
# The Length of Each Side
[Param... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Measure-Interest.ps1 | Measure-Interest.ps1 | function Measure-Interest
{
<#
.Synopsis
Measures compound interest
.Description
Measures compound interest, using the formula:
### P = C(1 + r/n)^nt
Where:
* P is the future value
* C is the initial deposit,
... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Optimize-Fraction.ps1 | Optimize-Fraction.ps1 | function Optimize-Fraction
{
<#
.Synopsis
Optimizes fractions
.Description
Simplifies fractions into their optimal form
.Example
Optimize-Fraction 2 16
#>
param(
# The numerator
#|Float
[Parameter(Mandatory=$true,Position=0)]
[double]
$N... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Invoke-Arithmetic.ps1 | Invoke-Arithmetic.ps1 | function Invoke-Arithmetic
{
<#
.Synopsis
Does simple arithmetic
.Description
Does simple arithmetic
.Example
Invoke-Arithmetic { 1 + 1}
.Example
Invoke-Arithmetic { 10 %2 }
#>
param(
# Simple arithmetic, like:
# 1+1
# 2*20... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-ParallelogramArea.ps1 | Get-ParallelogramArea.ps1 | function Get-ParallelogramArea
{
<#
.Synopsis
Gets the area of a Parallelogram
.Description
Gets the area of a Parallelogram, using the simple equation
Area = bh
#>
[CmdletBinding(DefaultParameterSetName='ASideBSide')]
param(
# The Parallelogram ... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-Circumference.ps1 | Get-Circumference.ps1 | function Get-CircleCircumference
{
<#
.Synopsis
Gets the Circumference of a circle
.Description
Gets the Circumference of a circle, using the simple equation
Circumference = Pi * Radius^2
#>
[CmdletBinding(DefaultParameterSetName='Radius')]
par... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-Median.ps1 | Get-Median.ps1 | None |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Get-TriangleArea.ps1 | Get-TriangleArea.ps1 | function Get-TriangleArea
{
<#
.Synopsis
Gets the area of a triangle
.Description
Gets the area of a triangle, by solving the following equation:
S = 1/2 * base * height
#>
[CmdletBinding(DefaultParameterSetName='TriangleAreaByBaseAndHeight')]
param(
... |
PowerShellCorpus/PowerShellGallery/Formulaic/0.2.1.0/Invoke-Equation.ps1 | Invoke-Equation.ps1 | function Invoke-Equation
{
<#
.Synopsis
Invokes a PowerShell script for an equation
.Description
Writes a PowerShell script for an equation.
To make sure that this is safe, you can only do the following things inside of a script.
Use st... |
PowerShellCorpus/PowerShellGallery/NuGet/1.3.3/Examples/dsc_configuration.ps1 | dsc_configuration.ps1 | $ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
PSDscAllowPlainTextPassword = $True
}
)
}
$pass = (convertto-securestring -asplaintext -force 'vagrant')
$cred = (New-Object System.Management.Automation.PSCredential ('vagrant', $pass))
configuration... |
PowerShellCorpus/PowerShellGallery/NuGet/1.3.3/test/integration/default/pester/default.Tests.ps1 | default.Tests.ps1 | class site {
#Properties
[string]$Name
[int]$Port
[string]$Path
#Constructors
site () {}
site ([string]$name,[int]$port,[string]$path) {
$this.Name = $name
$this.Port = $port
$this.Path = $path
}
}
$sites = [site]::new('modules',81,'c:\Modules'),[site]::new('packages',82,'c:\packages')
d... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/helper/HelperWeb.ps1 | HelperWeb.ps1 | class HelperWeb {
static [string] createQueryString ([hashtable]$hashTable) {
$i = 0
$queryString = "?"
foreach ($hash in $hashTable.GetEnumerator()) {
$i++
$queryString += $hash.Name + "=" + $hash.Value
if ($i -lt $HashTable.Count) {
$quer... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/helper/HelperXml.ps1 | HelperXml.ps1 | class HelperXml {
# Element without Members
static [System.Xml.Linq.XElement] createXmlWithoutMembers([string]$propertyName, [string]$data) {
if ($data) {
return [System.Xml.Linq.XElement]::new($propertyName,$data)
} else {
return $null
}
}
# Element with... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/helper/HelperRegex.ps1 | HelperRegex.ps1 | class HelperRegex {
static [string]$Ipv4 = '\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b'
static [string]$Fqdn = '(?=^.{1,254}$)(^(?:(?!\d|-)[a-zA-Z0-9\-]{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)'
# function for checking regular expressions
static [string] checkRege... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/base/PaConfigObject.ps1 | PaConfigObject.ps1 | class PaConfigObject {
# Generic Properties
[string]$Vsys = 'shared'
[string]$Device
[string]$ConfigNode
hidden [string]$ManualXml
# BaseXPath
[string] getBaseXPath() {
$xPath += "/config"
if ($this.Vsys -eq 'shared') {
$xPath += '/shared/'
$xPath... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaRadiusProfile.ps1 | PaRadiusProfile.ps1 | class PaRadiusProfile : PaConfigObject {
[string]$Name
[bool]$AdminUseOnly
[int]$Timeout
[int]$Retries
[array]$Servers
[string]$ConfigNode = "server-profile/radius"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($this.Name) {
... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaPasswordProfile.ps1 | PaPasswordProfile.ps1 | class PaPasswordProfile : PaConfigObject {
[string]$Name
[int]$ExpirationPeriod
[int]$ExpirationWarningPeriod
[int]$PostExpirationAdminLoginCount
[int]$PostExpirationGracePeriod
[string]$Vsys = 'shared'
[string]$ConfigNode = "mgt-config/password-profile"
# BaseXPath
[string] getBas... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaAdmin.ps1 | PaAdmin.ps1 | class PaAdmin : PaConfigObject {
[string]$Name
[string]$AuthProfile
[bool]$ClientCert
[bool]$PublicKey
[string]$AdminType
[string]$AdminProfile
[array]$VsysAccess
[string]$PasswordProfile
[string]$ConfigNode = "mgt-config/users"
# BaseXPath
[string] getBaseXPath() {
... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaAddressGroup.ps1 | PaAddressGroup.ps1 | class PaAddressGroup : PaConfigObject {
[string]$Name
[string]$Description
[string]$Type
[array]$Members
[array]$Tags
[string]$Filter
[string]$ConfigNode = "address-group"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($this... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaSession.ps1 | PaSession.ps1 | class PaSession {
[double]$Id
[string]$Vsys
[string]$Application
[string]$State
[string]$Type
[string]$Source
[string]$SourcePort
[string]$SourceZone
[string]$SourceTranslatedIp
[string]$SourceTranslatedPort
[string]$Destination
[string]$DestinationPort
[string]$Desti... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaAuthenticationProfile.ps1 | PaAuthenticationProfile.ps1 | class PaAuthenticationProfile : PaConfigObject {
[string]$Name
[string]$Type
[string]$UserDomain
[array]$AllowList
[int]$FailedAttempts
[int]$LockoutTime
[string]$ServerProfile
[string]$LoginAttribute
[string]$PasswordExpiryWarning
[string]$UsernameModifier
[bool]$RetrieveGro... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaAuthServer.ps1 | PaAuthServer.ps1 | class PaAuthServer {
[string]$Name
[string]$Server
[string]$Port
} |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaTacacsProfile.ps1 | PaTacacsProfile.ps1 | class PaTacacsProfile : PaConfigObject {
[string]$Name
[bool]$AdminUseOnly
[int]$Timeout
[bool]$UseSingleConnection
[array]$Servers
[string]$ConfigNode = "server-profile/tacplus"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaDevice.ps1 | PaDevice.ps1 | class PaDevice {
[ValidateRange(1,65535)]
[int]$Port = 443
[string]$ApiKey
[ValidateSet('http','https')]
[string]$Protocol = "https"
[string]$Name
[string]$IpAddress
[string]$Model
[string]$Serial
[string]$OsVersion
[string]$GpAgent
[string]$AppVersion
[string... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaKerberosProfile.ps1 | PaKerberosProfile.ps1 | class PaKerberosProfile : PaConfigObject {
[string]$Name
[bool]$AdminUseOnly
[array]$Servers
[string]$ConfigNode = "server-profile/kerberos"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($this.Name) {
$returnXPath += "/ent... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaAddress.ps1 | PaAddress.ps1 | class PaAddress : PaConfigObject {
[string]$Name
[string]$Description
[string]$Type
[string]$Address
[array]$Tags
[string]$ConfigNode = "address"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($this.Name) {
$returnXP... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/classes/main/PaLdapProfile.ps1 | PaLdapProfile.ps1 | class PaLdapProfile : PaConfigObject {
[string]$Name
[bool]$AdminUseOnly
[string]$Type
[string]$BaseDN
[string]$BindDN
[int]$BindTimeout
[int]$SearchTimout
[int]$RetryInterval
[bool]$RequireSSL
[bool]$VerifyServerCertificate
[array]$Servers
[string]$ConfigNode... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaSession.ps1 | Get-PaSession.ps1 | function Get-PaSession {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,ParameterSetName="id")]
[int]$Id,
[Parameter(Mandatory=$False,ParameterSetName="filter")]
[string]$Application,
[Parameter(Mandatory=$False,ParameterSetName="filter")]
[string]$Destination,
[Parameter(... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaDevice.ps1 | Get-PaDevice.ps1 | function Get-PaDevice {
<#
.SYNOPSIS
Establishes initial connection to Palo Alto API.
.DESCRIPTION
The Get-PaDevice cmdlet establishes and validates connection parameters to allow further communications to the Palo Alto API. The cmdlet needs at least two parameters:
- The device IP address or FQDN
- A v... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaKerberosProfile.ps1 | Get-PaKerberosProfile.ps1 | function Get-PaKerberosProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys = "shared",
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaKerberosPro... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Set-PaConfig.ps1 | Set-PaConfig.ps1 | function Set-PaConfig {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True,Position=0,ParameterSetName="manual")]
[string]$Xpath = "/config",
[Parameter(Mandatory=$True,Position=1,ParameterSetName="manual")]
[string]$ElementAsString,
[Parameter(Mandatory=$True,Position=1,ParameterSetName=... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaPasswordProfile.ps1 | Get-PaPasswordProfile.ps1 | function Get-PaPasswordProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys,
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaPasswordProfile:"
... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Invoke-PaSessionTracker.ps1 | Invoke-PaSessionTracker.ps1 | function Invoke-PaSessionTracker {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False)]
[int]$Interval = 5,
[Parameter(Mandatory=$False)]
[array]$ShowProperties = @("StartTime","Id","Application","Source","Destination","State","DestinationPort"),
[Parameter(Mandatory=$False)]
[in... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaVsys.ps1 | Get-PaVsys.ps1 | function Get-PaVsys {
[CmdletBinding()]
Param (
)
$VerbosePrefix = "Get-PaVsys:"
if ($global:PaDeviceObject.Connected) {
# Get the data
$Operation = '<show><system><state><filter-pretty>cfg.dns-vsys</filter-pretty></state></system></show>'
$Result = Invoke-PaOperation $Ope... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaConfig.ps1 | Get-PaConfig.ps1 | function Get-PaConfig {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$XPath = "/config",
[Parameter(Mandatory=$False,Position=3)]
[ValidateSet("get","show")]
[string]$Action = "show"
)
$VerbosePrefix = "Get-PaConfig:"
if ($global:Pa... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaAuthenticationProfile.ps1 | Get-PaAuthenticationProfile.ps1 | function Get-PaAuthenticationProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys = "shared",
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaAuthe... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaLdapProfile.ps1 | Get-PaLdapProfile.ps1 | function Get-PaLdapProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys = "shared",
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaLdapProfile:"
... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaRadiusProfile.ps1 | Get-PaRadiusProfile.ps1 | function Get-PaRadiusProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys = "shared",
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaRadiusProfile... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaAdmin.ps1 | Get-PaAdmin.ps1 | function Get-PaAdmin {
<#
.SYNOPSIS
Pulls locally configured Administrator accounts for a Palo Alto Device.
.DESCRIPTION
Pulls locally configured Administrator accounts for a Palo Alto Device.
.EXAMPLE
Get-PaAdmin
Returns all locally configured Administrator accounts.
.EXAMPLE
Get-PaAdmi... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Invoke-PaOperation.ps1 | Invoke-PaOperation.ps1 | function Invoke-PaOperation {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Command
)
$VerbosePrefix = "Invoke-PaOperation:"
$CheckConnection = $global:PaDeviceObject.checkConnectionStatus($VerbosePrefix)
return $global:PaDeviceObject.invokeOperationalQuery($Com... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaAddress.ps1 | Get-PaAddress.ps1 | function Get-PaAddress {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys,
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaAddress:"
if ($global:PaD... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaTacacsProfile.ps1 | Get-PaTacacsProfile.ps1 | function Get-PaTacacsProfile {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$False,Position=0)]
[string]$Name,
[Parameter(Mandatory=$False,Position=1)]
[string]$Vsys = "shared",
[Parameter(Mandatory=$False,Position=2)]
[string]$Device
)
$VerbosePrefix = "Get-PaTacacsProfile... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/cmdlets/Get-PaAddressGroup.ps1 | Get-PaAddressGroup.ps1 | function Get-PaAddressGroup {
<#
.SYNOPSIS
Retrieves Address Group objects for a Palo Alto Device.
.DESCRIPTION
Retrieves Address Group objects for a Palo Alto Device.
.EXAMPLE
Get-PaAddressGroup
Returns all Address Groups for all Vsys/Devices configured.
.EXAMPLE
Get-PaAddressGroup -Nam... |
PowerShellCorpus/PowerShellGallery/poweralto3/3.0.5/src/helpers/LoadAssembly.ps1 | LoadAssembly.ps1 | if ($PSVersionTable.PSVersion.Major -lt 6) {
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")
} |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Assert-InWatchmen.ps1 | Assert-InWatchmen.ps1 | function Assert-InWatchmen {
param ($Command)
# Verify we aren't calling the command completly outside of a Watchmen file
if ($null -eq $script:Watchmen) {
throw "The command [$Command] may only be used inside a Watchmen configuration file."
}
# WatchmenOptions
if ($script:Wat... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Invoke-WatchmeNotifier.ps1 | Invoke-WatchmeNotifier.ps1 | function Invoke-WatchmenNotifier {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[pscustomobject[]]$TestResults,
[pscustomobject]$WatchmenTest
)
begin {
# If this test doesn't have any notifiers, don't bother
# going through the p... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/New-OperationValidationInfo.ps1 | New-OperationValidationInfo.ps1 | function New-OperationValidationInfo {
param (
[Parameter(Mandatory=$true)][string]$File,
[Parameter(Mandatory=$true)][string]$FilePath,
[Parameter(Mandatory=$true)][string[]]$Name,
[Parameter()][string[]]$TestCases,
[Parameter(Mandatory=$true)][ValidateSet("None","Simp... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Convert-TestResult.ps1 | Convert-TestResult.ps1 | Function Convert-TestResult {
param ( $result )
foreach ( $testResult in $result.TestResult ) {
$testError = $null
if ( $testResult.Result -eq "Failed" ) {
$testError = New-OperationValidationFailure -Stacktrace $testResult.StackTrace -FailureMessage $testResult.FailureMessage
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/GetOperationValidation.ps1 | GetOperationValidation.ps1 | function GetOperationValidation {
<#
.SYNOPSIS
Retrieve the operational tests from modules
.DESCRIPTION
Modules which include a Diagnostics directory are inspected for
Pester tests in either the "Simple" or "Comprehensive" directories.
If files are found in those directories, they w... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Get-TestFromScript.ps1 | Get-TestFromScript.ps1 | function Get-TestFromScript {
param (
[string]$scriptPath
)
$errs = $null
$tok =[System.Management.Automation.PSParser]::Tokenize((get-content -read 0 -Path $scriptPath), [ref]$Errs)
#write-verbose -Message $scriptPath
for($i = 0; $i -lt $tok.count; $i++) {
if ( $tok[... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Invoke-OvfTest.ps1 | Invoke-OvfTest.ps1 | function Invoke-OvfTest {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[pscustomobject[]]$OvfTestInfo,
[parameter(Mandatory)]
$Test
)
begin { }
process {
foreach ($ovfTest in $OvfTestInfo) {
Write-Host -Object... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/New-OperationValidationResult.ps1 | New-OperationValidationResult.ps1 | function New-OperationValidationResult {
param (
[Parameter(Mandatory=$true)][string]$Module,
[Parameter(Mandatory=$true)][string]$FileName,
[Parameter(Mandatory=$true)][string]$Name,
[Parameter(Mandatory=$true)][string]$Result,
[Parameter()][object]$RawResult,
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/New-OperationValidationFailure.ps1 | New-OperationValidationFailure.ps1 | function New-OperationValidationFailure {
param (
[Parameter(Mandatory=$true)][string]$StackTrace,
[Parameter(Mandatory=$true)][string]$FailureMessage
)
$o = [pscustomobject]@{
PSTypeName = 'OperationValidationFailure'
StackTrace = $StackTrace
FailureMessage... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Install-OvfModule.ps1 | Install-OvfModule.ps1 | function Install-OvfModule {
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Test
)
Write-Verbose -Message "Attemping to retrieve module from repository [$($Test.Source)]"
if ($Test.Version) {
$foundModule = Find-Module -Name $Test.ModuleName -Repository $Test.So... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/ConvertFrom-PlaceholderString.ps1 | ConvertFrom-PlaceholderString.ps1 | Function ConvertFrom-PlaceholderString {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[string[]]$InputObject,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'OperationValidationResult' })]
[pscustomobject]$Results
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Get-OvfTestInfo.ps1 | Get-OvfTestInfo.ps1 | function Get-OvfTestInfo {
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Test
)
$params = @{
ModuleName = $Test.ModuleName
Verbose = $false
}
# Optionally get a test type
if ($Test.Type -eq 'Simple' -or $Test.Type -eq 'Comprehensive') {
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/InvokeOperationValidation.ps1 | InvokeOperationValidation.ps1 | function InvokeOperationValidation {
<#
.SYNOPSIS
Invoke the operational tests from modules
.DESCRIPTION
Modules which include Diagnostics tests are executed via this cmdlet
.PARAMETER testFilePath
The path to a diagnostic test to execute. By default all discoverable diagnostics w... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Initialize-Watchmen.ps1 | Initialize-Watchmen.ps1 | function Initialize-Watchmen {
[cmdletbinding()]
param()
Write-Verbose 'Initializing Watchmen config'
Remove-Variable -Name Watchmen -Scope Global -ErrorAction Ignore
$defaultNotifierCondition = 'OnFailure'
$script:Watchmen = [pscustomobject]@{
PSTypeName = 'Watchmen.State'
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierEmail.ps1 | Invoke-NotifierEmail.ps1 | function Invoke-NotifierEmail {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.Email' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObject.TypeNam... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierLogFile.ps1 | Invoke-NotifierLogFile.ps1 | function Invoke-NotifierLogFile {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.LogFile' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObject.Typ... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierInfluxDB.ps1 | Invoke-NotifierInfluxDB.ps1 |
function Invoke-NotifierInfluxDB {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.InfluxDB' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObject... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierSlack.ps1 | Invoke-NotifierSlack.ps1 | #requires -modules PSSlack
function Invoke-NotifierSlack {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.Slack' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[Valida... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierEventLog.ps1 | Invoke-NotifierEventLog.ps1 | function Invoke-NotifierEventLog {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.EventLog' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObject.T... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierSyslog.ps1 | Invoke-NotifierSyslog.ps1 | #requires -modules Posh-SYSLOG
function Invoke-NotifierSyslog {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.Syslog' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Private/Notifiers/Invoke-NotifierPowerShell.ps1 | Invoke-NotifierPowerShell.ps1 | function Invoke-NotifierPowerShell {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({ $_.PSObject.TypeNames[0] -eq 'Watchmen.Notifier.PowerShell' })]
[pscustomobject]$Notifier,
[parameter(Mandatory)]
[ValidateScript({ $_.PSObje... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/version.ps1 | version.ps1 | function Version {
param(
[parameter(Mandatory, Position = 0)]
[string]$Version
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvocation.MyCommand.Name
}
process {
$scri... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/WatchmenOptions.ps1 | WatchmenOptions.ps1 | function WatchmenOptions {
[cmdletbinding()]
param(
[scriptblock]$Script
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
# Mark that we are inside an 'WatchmenOptions' block and subsequent commands are allowed
$script:Watchmen... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/parameters.ps1 | parameters.ps1 | function Parameters {
param(
[Parameter(Mandatory)]
[hashtable]$Parameters
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvocation.MyCommand.Name
}
process {
$script:wa... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Email.ps1 | Email.ps1 | function Email {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[hashtable]$Options,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -Messa... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Notifies.ps1 | Notifies.ps1 | function Notifies {
param(
[parameter(Mandatory, Position = 0)]
[scriptblock]$Script,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenOptions
)
begin {
Write-Debug -Message "Entering: $(... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/test.ps1 | test.ps1 | function Test {
[cmdletbinding()]
param(
[string]$Test = '*'
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvocation.MyCommand.Name
}
process {
$script:watchmen.ThisTest.Te... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/TestType.ps1 | TestType.ps1 | function TestType {
param(
[parameter(Mandatory, Position = 0)]
[ValidateSet('Simple', 'Comprehensive', 'All')]
[string]$Type
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvocatio... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/InfluxDB.ps1 | InfluxDB.ps1 | function InfluxDB {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[hashtable]$Options,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -Me... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Slack.ps1 | Slack.ps1 | function Slack {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[hashtable[]]$Options,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -Mes... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/fromsource.ps1 | fromsource.ps1 | function FromSource {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[string]$Source
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvocation.MyCommand.Name
}
... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/PowerShell.ps1 | PowerShell.ps1 | function PowerShell {
[cmdletbinding(DefaultParameterSetName = 'ScriptBlock')]
param(
[parameter(Mandatory, Position = 0, ParameterSetName = 'ScriptBlock')]
[scriptblock]$ScriptBlock,
#[ValidateScript({Test-Path $_})]
[parameter(Mandatory, Position = 0, ParameterSetName =... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/LogFile.ps1 | LogFile.ps1 | function LogFile {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[string[]]$Path,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -Message... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Invoke-WatchmenTest.ps1 | Invoke-WatchmenTest.ps1 | function Invoke-WatchmenTest {
[cmdletbinding(DefaultParameterSetName = 'File')]
param(
[parameter(ParameterSetName = 'File', Mandatory, ValueFromPipeline)]
[ValidateScript({
Test-Path -Path $_
})]
[string[]]$Path,
[parameter(ParameterSetName = 'File... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/WatchmenTest.ps1 | WatchmenTest.ps1 | function WatchmenTest {
[cmdletbinding(DefaultParameterSetName = 'NoName')]
param(
[parameter( ParameterSetName = 'Name', Position = 0)]
[string]$Name = (New-Guid).ToString(),
[parameter( ParameterSetName = 'Name', Position = 1, Mandatory = $True)]
[parameter( ParameterSe... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Get-WatchmenTest.ps1 | Get-WatchmenTest.ps1 | function Get-WatchmenTest {
[cmdletbinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[ValidateScript({Test-Path $_})]
[string[]]$Path = (Get-Location).Path,
[switch]$Recurse
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/EventLog.ps1 | EventLog.ps1 | function EventLog {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[hashtable[]]$Options,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/Syslog.ps1 | Syslog.ps1 | function Syslog {
[cmdletbinding()]
param(
[parameter(Mandatory, Position = 0)]
[string[]]$Endpoints,
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$When = $script:Watchmen.Options.NotifierConditions.WatchmenTest
)
begin {
Write-Debug -Mes... |
PowerShellCorpus/PowerShellGallery/Watchmen/1.2.1/Public/When.ps1 | When.ps1 | function When {
param(
[parameter(Mandatory, Position = 0)]
[ValidateSet('Always', 'OnSuccess', 'OnFailure')]
[string]$Condition
)
begin {
Write-Debug -Message "Entering: $($PSCmdlet.MyInvocation.MyCommand.Name)"
Assert-InWatchmen -Command $PSCmdlet.MyInvoca... |
PowerShellCorpus/PowerShellGallery/BitsServer/0.1.5/Examples/dsc_configuration.ps1 | dsc_configuration.ps1 | configuration default {
param (
$ComputerName = 'localhost'
)
Import-DscResource -Module BitsServer
node $ComputerName {
BitsServer 'alt_bits' {
path = 'c:\package_mgr\bits'
webSiteName = 'alt_bits'
port = 81
protocol = 'http'
}
}
} |
PowerShellCorpus/PowerShellGallery/BitsServer/0.1.5/test/integration/default/pester/default.Tests.ps1 | default.Tests.ps1 | describe "Testing the default configuration of cBitsServer" {
context "Bits website | napmSources | W3SVC" {
it "ensures IIS installed" {
(get-windowsfeature -name web-server).installed | should be $true
}
it "checks for bits website" {
get-website -name "Bits" | shou... |
PowerShellCorpus/PowerShellGallery/xPhp/1.2.0.0/tests/xPhp.Schema.Tests.ps1 | xPhp.Schema.Tests.ps1 | <#
.SUMMARY
Test suite for xPhp.Schema.psm1.
This must be run from an elevated PowerShell session.
#>
[CmdletBinding()]
param ()
$ErrorActionPreference = 'stop'
Set-StrictMode -Version latest
$requiredModules = @( 'xPSDesiredStateConfiguration', 'xWebAdministration' )
$xPhpModuleRoot = "${en... |
PowerShellCorpus/PowerShellGallery/xPhp/1.2.0.0/Samples/InstallRequiredModules.ps1 | InstallRequiredModules.ps1 | # This Script installs the required modules for the Php Sample
# It uses the PowerShell Resource Gallery, see https://msconfiggallery.cloudapp.net/
# This requires WMF 5. If you don't have WMF 5, Please install the modules manually.
Write-Host "Installing required modules..."
Install-Module xWebAdministration -M... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.