full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/PoshInternals/1.0.31/Tests/PoshExec.Tests.ps1 | PoshExec.Tests.ps1 | Describe "PoshExec" {
. (Join-Path $PSScriptRoot 'InitializeTest.ps1')
Context "Start-RemoteProcess" {
it "Starts a process on the remote machine" -Skip {
Start-RemoteProcess -ComputerName add2012 -Credential mdnvdi\adriscoll -Interact -FilePath C:\windows\syswow64\notepad.exe
}
}
} |
PowerShellCorpus/PowerShellGallery/PoshInternals/1.0.31/Tests/Mutex.Tests.ps1 | Mutex.Tests.ps1 | Describe "Mutex" {
. (Join-Path $PSScriptRoot 'InitializeTest.ps1')
Context "Enter-Mutex" {
$Mutex = New-Mutex -Name "MyMutex" -InitialOwner $true
try {
Enter-Mutex $Mutex
Exit-Mutex $Mutex
}
finally {
$Mutex.Dispose()
}
}
}
|
PowerShellCorpus/PowerShellGallery/Posh-Vault/0.1.5/Get-VaultCredential.ps1 | Get-VaultCredential.ps1 | <#
.SYNOPSIS
Get the credential stored in the PasswordVault for a given resource.
.PARAMETER Resource
The resource to fetch from the PasswordVault
.PARAMETER User
The user connected to the resource
.EXAMPLE
Get-Credential https://msdn.microsoft.com
Description
-----------
Gets the credemtials... |
PowerShellCorpus/PowerShellGallery/Posh-Vault/0.1.5/Set-VaultCredential.ps1 | Set-VaultCredential.ps1 | <#
.SYNOPSIS
Store the given credential in the PasswordVault for a given resource.
.PARAMETER Resource
The resource to remove from the PasswordVault
.PARAMETER User
The user connected to the resource
.PARAMETER Password
The password fot the given user
.PARAMETER Credential
The user stored in Credent... |
PowerShellCorpus/PowerShellGallery/Posh-Vault/0.1.5/Remove-VaultCredential.ps1 | Remove-VaultCredential.ps1 | <#
.SYNOPSIS
Remove the given credential in the PasswordVault for a given resource.
.PARAMETER Resource
The resource to remove from the PasswordVault
.PARAMETER User
The user connected to the resource
.PARAMETER Credential
The user stored in Credential connected to the resource
.EXAMPLE
Remove-Cre... |
PowerShellCorpus/PowerShellGallery/Posh-Vault/0.1.5/Posh-Vault.ArgumentCompleters.ps1 | Posh-Vault.ArgumentCompleters.ps1 | $ArgumentCompleter = @{
CommandName = @('Get-VaultCredential',
'Set-VaultCredential',
'Remove-VaultCredential'
);
ParameterName = 'Resource';
ScriptBlock = {
<#
.SYNOPSIS
Auto-complete the -Resource parameter value for Vault Powershell Cm... |
PowerShellCorpus/PowerShellGallery/NuGetMetadata/1.0.0/NuGetMetadata.Tests.ps1 | NuGetMetadata.Tests.ps1 | Import-Module "./NuGetMetadata.psm1"
$filePath = @{
test = "./test/test.zip"
relative = "./test/test.zip"
nupkg = "./test/example.nupkg"
nonExistent = "./non-existent.file"
notZipFile = "./test/test.txt"
}
$filePath['absolute'] = (Resolve-Path $filePath.relative).Path
$... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/New-FTPItem.ps1 | New-FTPItem.ps1 | Function New-FTPItem
{
<#
.SYNOPSIS
Creates a new folder on ftp.
.DESCRIPTION
The New-FTPItem cmdlet creates a new folder in specific path in current ftp session.
.PARAMETER Path
Specifies a path to ftp location or file.
.PARAMETER Name
Specifies a name of item.
.PAR... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Rename-FTPItem.ps1 | Rename-FTPItem.ps1 | Function Rename-FTPItem
{
<#
.SYNOPSIS
Renames an item in ftp session. Additionally it can be used for move items between folders.
.DESCRIPTION
The Rename-FTPItem cmdlet changes the name of a specified item. This cmdlet does not affect the content of the item being renamed.
.PARAMETER Path... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Get-FTPItem.ps1 | Get-FTPItem.ps1 | Function Get-FTPItem
{
<#
.SYNOPSIS
Send specific file from ftop server to location disk.
.DESCRIPTION
The Get-FTPItem cmdlet download file to specific location on local machine.
.PARAMETER Path
Specifies a path to ftp location.
.PARAMETER LocalPath
Specifies a local path.... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Remove-FTPItem.ps1 | Remove-FTPItem.ps1 | Function Remove-FTPItem
{
<#
.SYNOPSIS
Remove specific item from ftp server.
.DESCRIPTION
The Remove-FTPItem cmdlet remove item from specific location on ftp server.
.PARAMETER Path
Specifies a path to ftp location.
.PARAMETER Recurse
Remove items recursively.
.PA... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Add-FTPItem.ps1 | Add-FTPItem.ps1 | Function Add-FTPItem
{
<#
.SYNOPSIS
Send file to specific ftp location.
.DESCRIPTION
The Add-FTPItem cmdlet send file to specific location on ftp server.
.PARAMETER Path
Specifies a path to ftp location.
.PARAMETER LocalPath
Specifies a local path.
.PARAMETER BufferSi... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Set-FTPConnection.ps1 | Set-FTPConnection.ps1 | Function Set-FTPConnection
{
<#
.SYNOPSIS
Set config to ftp Connection.
.DESCRIPTION
The Set-FTPConnection cmdlet creates a Windows PowerShell configuration to ftp server. When you create a ftp connection, you may run multiple commands that use this config.
.PARAMETER Credential
Spec... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Get-FTPItemSize.ps1 | Get-FTPItemSize.ps1 | Function Get-FTPItemSize
{
<#
.SYNOPSIS
Gets the item size.
.DESCRIPTION
The Get-FTPItemSize cmdlet gets the specific item size.
.PARAMETER Path
Specifies a path to ftp location.
.PARAMETER Silent
Hide warnings.
.PARAMETER Session
Specifies a friendly name fo... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Get-FTPChildItem.ps1 | Get-FTPChildItem.ps1 | Function Get-FTPChildItem
{
<#
.SYNOPSIS
Gets the item and child items from ftp location.
.DESCRIPTION
The Get-FTPChildItem cmdlet gets the items from ftp locations. If the item is a container, it gets the items inside the container, known as child items.
.PARAMETER Path
Specifies a path to ftp... |
PowerShellCorpus/PowerShellGallery/PSFTP/1.7/Get-FTPConnection.ps1 | Get-FTPConnection.ps1 | Function Get-FTPConnection
{
<#
.SYNOPSIS
Get config to ftp Connection.
.DESCRIPTION
The Get-FTPConnection cmdlet create a list of registered PSFTP sessions.
.PARAMETER Session
Specifies a friendly name for the ftp session.
.EXAMPLE
Get-FTPConnection
.EXAMPLE
Get... |
PowerShellCorpus/PowerShellGallery/biz.dfch.PS.Redmine.Client/2.0.2.20160717/Import-Module.ps1 | Import-Module.ps1 | # Import-Module.ps1
#
# Place any pre-initialisation script here
# Note:
# * When executed the module is not yet loaded
# * Everything you define here (e.g. a variable) is defined OUTSIDE the module scope.
# If this script is loaded via "ScriptsToProcess" it will incorrectly
# show up as loaded module, see ... |
PowerShellCorpus/PowerShellGallery/biz.dfch.PS.Redmine.Client/2.0.2.20160717/Enter-Server.ps1 | Enter-Server.ps1 | function Enter-Server {
<#
.SYNOPSIS
Performs a login to a Redmine server.
.DESCRIPTION
Performs a login to a Redmine server.
This is the first Cmdlet to be executed and required for all other Cmdlets of this module. It creates a reference to redmine server.
If logging in via API key a password must still... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Private/Get-TeamviewerChoice.ps1 | Get-TeamviewerChoice.ps1 | function Get-TeamviewerChoice
{
[CmdletBinding()]
Param
(
[System.String]$Message = 'There were multiple matches',
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String[]]$Choices,
[System.Int32]$DefaultChoice = 0,
[S... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Private/Get-TeamviewerDeviceProperty.ps1 | Get-TeamviewerDeviceProperty.ps1 | function Get-TeamviewerDeviceProperty
{
[CmdletBinding(DefaultParameterSetName = 'remotecontrol_id')]
param
(
[Parameter(Mandatory=$true)]
[string]$ComputerName,
[Parameter(ParameterSetName = 'device_id')]
[switch]$device_id,
[Parameter(ParameterSetName = 'r... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Private/Resolve-TeamviewerConfigPath.ps1 | Resolve-TeamviewerConfigPath.ps1 | function Resolve-TeamviewerConfigPath
{
[CmdletBinding()]
[OutputType([String])]
param()
Begin
{
}
Process
{
Write-Verbose -Message 'Resolving Teamviewer Config Path'
$Global:TeamviewerConfigPath = "$env:APPDATA\Teamviewer"
Write-Verbose -Message "Teamviewer C... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Public/Set-TeamviewerAccessToken.ps1 | Set-TeamviewerAccessToken.ps1 | # .ExternalHelp Teamviewer-Help.xml
function Set-TeamviewerAccessToken
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[securestring]$AccessToken,
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)]
[securestring]$MasterPassword
)
... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Public/Update-TeamviewerDevice.ps1 | Update-TeamviewerDevice.ps1 | # .ExternalHelp Teamviewer-Help.xml
Function Update-TeamviewerDevice
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[string]$ComputerName,
[Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)]
[s... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Public/Initialize-Teamviewer.ps1 | Initialize-Teamviewer.ps1 | # .ExternalHelp Teamviewer-Help.xml
function Initialize-Teamviewer
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)]
[securestring]$MasterPassword
)
Begin
{
# Test if configuration file exists. ... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Public/Set-TeamviewerDeviceList.ps1 | Set-TeamviewerDeviceList.ps1 | # .ExternalHelp Teamviewer-Help.xml
Function Set-TeamviewerDeviceList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$false)]
[securestring]$AccessToken
)
Begin
{
Write-Verbose -Message 'Starting: Set Teamviewer Device List'
... |
PowerShellCorpus/PowerShellGallery/posh-teamviewer/1.0.1/Public/Connect-Teamviewer.ps1 | Connect-Teamviewer.ps1 | # .ExternalHelp Teamviewer-Help.xml
function Connect-Teamviewer
{
[CmdletBinding(DefaultParameterSetName = 'List')]
param
(
[Parameter(ParameterSetName = 'List', Mandatory=$true)]
[Parameter(ParameterSetName = 'Update', Mandatory=$true)]
[string[]]$ComputerName,
... |
PowerShellCorpus/PowerShellGallery/xIISWebBinding/1.0.0.1/DSCResources/xIISWebBinding/test.ps1 | test.ps1 | Configuration s
{
Import-DscResource -module admin*
Node xx
{
xIISWebBinding A
{
SiteName = "A"
Information = "*:80:www.A.com","10.0.0.0:80:www.AA.com"
Protocol = "Http"
Ensure = "present"
}
}
}
#Set-TargetRe... |
PowerShellCorpus/PowerShellGallery/xIISWebBinding/1.0.0.1/DSCResources/xIISWebBinding/Build.ps1 | Build.ps1 |
$SiteName = New-xDscResourceProperty -Name SiteName -Type String -Attribute Required
$Ensure = New-xDscResourceProperty -Name Ensure -Type String -Attribute Key -ValidateSet "Absent","Present"
$Information = New-xDscResourceProperty -Name Information -Type String[] -Attribute Required
$Protocol = New-xDscResource... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/Test-RunAsAdmin.ps1 | Test-RunAsAdmin.ps1 | Function Test-RunAsAdmin {
<#
.SYNOPSIS
Verifies if the current process is run as admin.
.DESCRIPTION
This function verifies whether the current process is running with administrator rights or not.
If so, it will return a value of $true; otherwise it will return a ... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/Get-PoshspecParam.ps1 | Get-PoshspecParam.ps1 | function Get-PoshspecParam {
[CmdletBinding(DefaultParameterSetName="Default")]
param(
[Parameter(Mandatory=$true, ParameterSetName="Default")]
[Parameter(Mandatory=$true, ParameterSetName="PropertyExpression")]
[string]
$TestName,
[Parameter(Mandatory=$true, Param... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/UserRightsAssignment.ps1 | UserRightsAssignment.ps1 | # The following region of code was retrieved from https://gallery.technet.microsoft.com/scriptcenter/Grant-Revoke-Query-user-26e259b0
# and was written by Tony Pombo for managing user rights assignments. I have stripped out the code for modifying user rights, leaving
# only the code necessary for verifying them.
Add... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/Invoke-PoshspecExpression.ps1 | Invoke-PoshspecExpression.ps1 | #Private - Build the It scriptblock based on parameters from Get-PoshspecParam
function Invoke-PoshspecExpression {
[CmdletBinding()]
param(
# Poshspec Param Object
[Parameter(Mandatory, Position=0)]
[PSCustomObject]
$InputObject
)
Write-Verbose -Message "I... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/Expand-PoshspecTestExpression.ps1 | Expand-PoshspecTestExpression.ps1 | function Expand-PoshspecTestExpression
{
[CmdletBinding()]
param (
[Parameter(Mandatory=$true, Position=0)]
[string]
$ObjectExpression,
[Parameter(Mandatory=$true, Position=1)]
[string]
$PropertyExpression
)
$cmd = [scriptblock]::Create('(' + $ObjectExpression + ')' + '.' ... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Private/SearchAd.ps1 | SearchAd.ps1 | function SearchAd {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Name,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateSet('User','Group','OrganizationalUnit')]
[string]$ObjectType
)
$searchString =... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Http.ps1 | Http.ps1 | <#
.SYNOPSIS
Test a Web Service.
.DESCRIPTION
Test that a Web Service is reachable and optionally returns specific content.
.PARAMETER Target
Specifies the Uniform Resource Identifier (URI) of the Internet resource to which the web request is sent.
.PARAMETER Property
Specifies a property of the... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/AuditPolicy.ps1 | AuditPolicy.ps1 | <#
.SYNOPSIS
Test an Audit Policy.
.DESCRIPTION
Test the setting of a particular audit policy .
.PARAMETER Target
Specifies the category of the Audit Policy.
.PARAMETER Qualifier
Specifies the subcategory of the Audit policy.
.PARAMETER Should
A Script Block defining a Pester Assertio... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Service.ps1 | Service.ps1 | <#
.SYNOPSIS
Test a Service.
.DESCRIPTION
Test the Status of a given Service.
.PARAMETER Target
Specifies the service names of service.
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
Service w32time { Should Be Running }
.EXAMPLE
Service bits { Should Be S... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/LocalGroup.ps1 | LocalGroup.ps1 | <#
.SYNOPSIS
Test if a local group exists.
.DESCRIPTION
Test if a local group exists.
.PARAMETER Target
The local group name to test for. Eg 'Administrators'
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
LocalGroup 'Administrators' { should not BeNullOrEmpty } ... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Share.ps1 | Share.ps1 | <#
.SYNOPSIS
Test if a share exists.
.DESCRIPTION
Test if a share exists.
.PARAMETER Target
The share name to test for. Eg 'C$' or 'MyShare'
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
Share 'MyShare' { should not BeNullOrEmpty }
.EXAMPLE
Share 'BadS... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Registry.ps1 | Registry.ps1 | <#
.SYNOPSIS
Test a Registry Key.
.DESCRIPTION
Test the Existance of a Key or the Value of a given Property.
.PARAMETER Target
Specifies the path to an item.
.PARAMETER Property
Specifies a property at the specified Path.
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXA... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/File.ps1 | File.ps1 | <#
.SYNOPSIS
Test a File.
.DESCRIPTION
Test the Existance or Contents of a File..
.PARAMETER Target
Specifies the path to an item.
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
File C:\inetpub\wwwroot\iisstart.htm { Should Exist }
.EXAMPLE
File C:\inetpub\www... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/TcpPort.ps1 | TcpPort.ps1 | <#
.SYNOPSIS
Test a a Tcp Port.
.DESCRIPTION
Test that a Tcp Port is listening and optionally validate any TestNetConnectionResult property.
.PARAMETER Target
Specifies the Domain Name System (DNS) name or IP address of the target computer.
.PARAMETER Qualifier
Specifies the TCP port number on t... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Hotfix.ps1 | Hotfix.ps1 | <#
.SYNOPSIS
Test if a Hotfix is installed.
.DESCRIPTION
Test if a Hotfix is installed.
.PARAMETER Target
The Hotfix ID. Eg KB1112233
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
Hotfix KB3116900 { Should Not BeNullOrEmpty}
.EXAMPLE
Hotfix KB1112233 { Sh... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Folder.ps1 | Folder.ps1 | <#
.SYNOPSIS
Test if a folder exists.
.DESCRIPTION
Test if a folder exists.
.PARAMETER Target
The path of the folder to search for.
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
folder $env:ProgramData { should exist }
.EXAMPLE
folder C:\badfolder { should no... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/UserRightsAssignment.ps1 | UserRightsAssignment.ps1 | <#
.SYNOPSIS
Test user rights assignments by user or by right.
.DESCRIPTION
Test to ensure that a specific account has particular rights assignments. You can specify to query either
by account, in which case your Should block will verify against the possible rights assigned to the account
being te... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/AppPool.ps1 | AppPool.ps1 | <#
.SYNOPSIS
Test an Application Pool
.DESCRIPTION
Used To Determine if Application Pool is Running and Validate Various Properties
.PARAMETER Target
The name of the App Pool to be Tested
.PARAMETER Property
The Property to be expanded. If Ommitted, Property Will Default to Status. Can handle ne... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Volume.ps1 | Volume.ps1 | <#
.SYNOPSIS
Test the volume specified
.DESCRIPTION
Can be specified to target a specific volume for testing
.PARAMETER Target
Specifies the drive letter or file system label of the volume to test
.PARAMETER Property
Specifies an optional property to test for on the volume
.PARAMETER Should
... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Firewall.ps1 | Firewall.ps1 | <#
.SYNOPSIS
Firewall Settings
.DESCRIPTION
Used To Determine if Firewall is Running Desired Settings
.PARAMETER Target
The name of the Firewall DisplayName to be Tested
.PARAMETER Property
The name of the Property of the Firewall Object to be Tested
.PARAMETER Should
A Script Block defin... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/WebSite.ps1 | WebSite.ps1 | <#
.SYNOPSIS
Test an Web Site
.DESCRIPTION
Used To Determine if Web Site is Running and Validate Various Properties
.PARAMETER Target
The name of the Web Site to be Tested
.PARAMETER Property
The Property to be expanded. If Ommitted, Property Will Default to Status. Can handle nested objects wit... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Package.ps1 | Package.ps1 | <#
.SYNOPSIS
Test for installed package.
.DESCRIPTION
Test that a specified package is installed.
.PARAMETER Target
Specifies the Display Name of the package to search for.
.PARAMETER Property
Specifies an optional property to test for on the package.
.PARAMETER Should
A Script Block de... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/LocalUser.ps1 | LocalUser.ps1 | <#
.SYNOPSIS
Test if a local user exists and is enabled.
.DESCRIPTION
Test if a local user exists and is enabled.
.PARAMETER Target
The local user name to test for. Eg 'Guest'
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
LocalGroup 'Guest' { should not BeNullOr... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/SoftwareProduct.ps1 | SoftwareProduct.ps1 | <#
.SYNOPSIS
Test the installed Software Packages.
.DESCRIPTION
Test the Existance of a Software Package or the Value of a given Property.
.PARAMETER Target
Specifies the path to an item.
.PARAMETER Property
Specifies a property at the specified Path.
.PARAMETER Should
A Script Block ... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/CimObject.ps1 | CimObject.ps1 | <#
.SYNOPSIS
Test the value of a CimObject Property.
.DESCRIPTION
Test the value of a CimObject Property. The Class can be provided with the Namespace. See Example.
.PARAMETER Target
Specifies the name of the CIM class for which to retrieve the CIM instances. Can be just the ClassName
in the defa... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/Interface.ps1 | Interface.ps1 | <#
.SYNOPSIS
Test a local network interface.
.DESCRIPTION
Test a local network interface and optionally and specific property.
.PARAMETER Target
Specifies the name of the network adapter to search for.
.PARAMETER Property
Specifies an optional property to test for on the adapter.
.PARAMETER S... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/ServerFeature.ps1 | ServerFeature.ps1 |
<#
.SYNOPSIS
Test if a Windows feature is installed.
.DESCRIPTION
Test if a Windows feature is installed.
Note that this function uses 'Get-WindowsFeature' to retrieve the list of features installed.
This cmdlet does not work on a desktop operating system to retieve the list of locally instal... |
PowerShellCorpus/PowerShellGallery/poshspec/2.2.1/Public/DnsHost.ps1 | DnsHost.ps1 | <#
.SYNOPSIS
Test DNS resolution to a host.
.DESCRIPTION
Test DNS resolution to a host.
.PARAMETER Target
The hostname to resolve in DNS.
.PARAMETER Should
A Script Block defining a Pester Assertion.
.EXAMPLE
dnshost nonexistenthost.mymadeupdomain.tld { should be $null } ... |
PowerShellCorpus/PowerShellGallery/SCOrchDev-GitIntegration/2.2.5/SCOrchDev-GitIntegration.tests.ps1 | SCOrchDev-GitIntegration.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$manifestPath = "$here\SCOrchDev-GitIntegration.psd1"
Import-Module $manifestPath -Force
Describe -Tags 'VersionChecks' 'SCOrchDev-F5 GitIntegration' {
$script:manifest = $null
It 'has a valid manifest' {
{
$script:manifest =... |
PowerShellCorpus/PowerShellGallery/EqualBird/1.0/GetAllCosmosDBConnectionString.ps1 | GetAllCosmosDBConnectionString.ps1 | function Get-AllCosmosDBConnectionString {
<#
.SYNOPSIS
Convenience function that calls `Get-CosmosDB | Get-AllCosmosDBConnectionString` and formats the results
.Example
Get-AllCosmosDBConnectionString
ResourceGroupName Name ConnectionString ... |
PowerShellCorpus/PowerShellGallery/EqualBird/1.0/GetCosmosDB.ps1 | GetCosmosDB.ps1 | function Get-CosmosDB {
<#
.SYNOPSIS
Gets all the Cosmos DB in your Azure subscription
.Example
Get-CosmosDB
Name : seinfeld
ResourceId : /subscriptions/xxxxxxxxxxxxxx/resourceGroups/Kramer-RG/providers/Microsoft.Do
cumentDb/databaseAcc... |
PowerShellCorpus/PowerShellGallery/EqualBird/1.0/GetCosmosDBConnectionString.ps1 | GetCosmosDBConnectionString.ps1 | function Get-CosmosDBConnectionString {
<#
.SYNOPSIS
Retrieves keys from your Cosmos DB and returns a connectstring for use in apps like "DocumentDB Data Migration Tool"
.DESCRIPTION
You can also use it with Get-CosmosDB. Piping it to Get-CosmosDBConnectionString to get the Conn... |
PowerShellCorpus/PowerShellGallery/MrAWindowsServices/0.3/Function-Start-StoppedAutomaticService.ps1 | Function-Start-StoppedAutomaticService.ps1 | <#
.Synopsis
This script starts any stopped Automatic services with exclusions.
.DESCRIPTION
The script defaults to check the localhost for any stopped Automatic services and
starts them. It can also run against a single remote computer or a list of remote
computers. The script will first check to se... |
PowerShellCorpus/PowerShellGallery/MrAWindowsServices/0.3/Function-Get-StoppedAutomaticService.ps1 | Function-Get-StoppedAutomaticService.ps1 | <#
.Synopsis
This script checks a remote computer using WMI for any Automatic services that are not running.
.DESCRIPTION
The script makes a WMI query for all services that have an Automatic start mode, but are stopped.
This is useful for checking servers after patching for any services that didn't start... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Classes/GitHubGist.ps1 | GitHubGist.ps1 | class GitHubGistFile {
}
class GitHubGist {
[string] $Name
[string] $Description
[string] $Owner
[GitHubGistFile[]] $Files;
GitHubGist() {
}
GitHubGist([string] $Name, [string] $Description, [string] $Owner) {
$this.Name = $Name;
$this.Owner = $Owner;
$... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Classes/GitHubIssue.ps1 | GitHubIssue.ps1 | class GitHubRepository {
[string] $Name
[string] $Description
[bool] $IsPrivate
}
class GitHubIssue {
### The GitHub repository that the issue belongs to
[GitHubRepository] $Repository
[string] $Title
[string] $Body
[string] $Assignee
[string] $Milestone
}
### In the G... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Classes/GitHubRepository.ps1 | GitHubRepository.ps1 | class GitHubRepository {
[string] $Owner
[string] $Name
[string] $Description
} |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Private/Invoke-GitHubApi.ps1 | Invoke-GitHubApi.ps1 | function Invoke-GitHubApi {
<#
.Synopsis
An internal function that is responsbile for invoking various GitHub REST methods.
.Parameter Headers
A HashTable of the HTTP request headers as key-value pairs. Some REST methods in the GitHub
API do not require any request headers, in which case this p... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Private/Get-GitHubToken.ps1 | Get-GitHubToken.ps1 | function Get-GitHubToken {
<#
.Synopsis
Internal function to retrieve the GitHub Personal Access Token from disk
.Notes
Created by Trevor Sullivan <trevor@trevorsullivan.net>
#>
[OutputType([System.Management.Automation.PSCredential])]
[CmdletBinding()]
param (
)
### Detect... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubToken.ps1 | Set-GitHubToken.ps1 | function Set-GitHubToken {
<#
.Synopsis
Internal function that obtains the username and Personal Access Token from the user.
.Notes
Created by Trevor Sullivan <trevor@trevorsullivan.net>
#>
[CmdletBinding()]
param (
)
### Invoke the GitHub Personal Access Token screen
Invok... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Get-GitHubGist.ps1 | Get-GitHubGist.ps1 | function Get-GitHubGist {
<#
.Synopsis
This command retrieves GitHub Gist.
.Description
This command is responsible for retrieving GitHub Gist.
.Parameter Owner
The Owner of the Gist to retrieve, defaults to the currently authenticated user.
.Parameter Id
The Id of the Gist to... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Test-GitHubAssignee.ps1 | Test-GitHubAssignee.ps1 | function Test-GitHubAssignee {
<#
.Synopsis
This function returns a boolean value, indicating whether or not a GitHub username is a valid assignee for the specified repository.
.Link
https://trevorsullivan.net
https://developer.github.com/v3/issues/assignees/#check-assignee
#>
[Cmdl... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Remove-GitHubGist.ps1 | Remove-GitHubGist.ps1 | function Remove-GitHubGist {
<#
.Synopsis
This command deletes a GitHub Gist code snippet.
.Description
This command is responsible for deleting GitHub Gist code snippets or files.
.Parameter Id
The Id of the Gist to remove or remove files from.
.Parameter FileName
If this... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubAuthenticatedUser.ps1 | Set-GitHubAuthenticatedUser.ps1 | function Set-GitHubAuthenticatedUser {
<#
.Synopsis
Updates information for the authenticated user.
.Example
### Update the user's company
Set-GitHubAuthenticatedUser -Company Microsoft;
.Example
### Update the user's location and hireable status
Set-GitHubAuthenticatedUser -Hireab... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Get-GitHubAuthenticatedUser.ps1 | Get-GitHubAuthenticatedUser.ps1 | function Get-GitHubAuthenticatedUser {
[OutputType([System.Object])]
[CmdletBinding()]
param (
)
$RestMethod = 'user'
$Result = Invoke-GitHubApi -RestMethod $RestMethod -Method Default
$Result
} |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubRepository.ps1 | Set-GitHubRepository.ps1 | function Set-GitHubRepository {
<#
.Synopsis
Updates the details for an existing GitHub repository.
.Description
This function updates the details for an existing GitHub repository. The parameters on this function enable you to
update the repository's attributes including:
- Name
-... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Find-GitHubRepository.ps1 | Find-GitHubRepository.ps1 | function Find-GitHubRepository {
<#
.Synopsis
This function searches for repositories on GitHub.
.Parameter SortBy
Optional. Choose the property to sort on, for GitHub repository search results:
- Default: Best match
- Stars: Sort by the number of stars the repositories have
... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubGist.ps1 | Set-GitHubGist.ps1 | function Set-GitHubGist {
<#
.Synopsis
This command updates a GitHub Gist code snippet.
.Description
This command is responsible for updating GitHub Gist code snippets.
.Notes
.Link
https://trevorsullivan.net
https://developer.github.com/v3/gists
#>
[CmdletBi... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/New-GitHubRepository.ps1 | New-GitHubRepository.ps1 | function New-GitHubRepository {
<#
.Synopsis
Creates a new GitHub Repository, with the specified name.
.Parameter Name
The name of the new GitHub repository that will be created. This is the only required parameter in order to instantiate a new GitHub Repository. The other parameters are optional, ... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Save-GitHubGist.ps1 | Save-GitHubGist.ps1 | Function Save-GitHubGist {
<#
.Synopsis
This command saves all files from a gist.
.Description
This command is responsible for saving each file that is associated with a gist to the local machine.
.Parameter Path
Path to create a parent folder named the 'ID' of the Gist, then places all Gi... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/New-GitHubIssue.ps1 | New-GitHubIssue.ps1 | function New-GitHubIssue {
<#
.Synopsis
Creates a new GitHub issue.
.Parameter Title
Required. The title of the new GitHub issue that will be created. This field doesn't support Markdown.
.Parameter Body
Optional. Defines the body text, using Markdown, for the GitHub issue. Most pe... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Remove-GitHubRepository.ps1 | Remove-GitHubRepository.ps1 | function Remove-GitHubRepository {
<#
.Synopsis
Deletes a GitHub repository, using the specified owner and repository name.
.Notes
Created by Trevor Sullivan <trevor@trevorsullivan.net>
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $Owner
, [... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubIssue.ps1 | Set-GitHubIssue.ps1 | function Set-GitHubIssue {
<#
.Synopsis
Creates a new GitHub issue.
.Parameter Title
Required. The title of the new GitHub issue that will be created. This field doesn't support Markdown.
.Parameter Body
Optional. Defines the body text, using Markdown, for the GitHub issue. Most pe... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Get-GitHubAssignee.ps1 | Get-GitHubAssignee.ps1 | function Get-GitHubAssignee {
<#
.Synopsis
This function returns a list of valid assignees for a GitHub repository.
.Link
https://trevorsullivan.net
https://developer.github.com/v3/issues/assignees/#list-assignees
#>
[CmdletBinding()]
param (
)
} |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/New-GitHubGist.ps1 | New-GitHubGist.ps1 | function New-GitHubGist {
<#
.Synopsis
This command creates a new GitHub Gist code snippet.
.Description
This command is responsible for creating new GitHub Gist code snippets.
.Parameter Path
Path(s) to files to use for content sources for the Gist. Each file in the Gist will be crea... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Functions/Public/Get-GitHubMilestone.ps1 | Get-GitHubMilestone.ps1 | function Get-GitHubMilestone {
<#
.Synopsis
Creates a new GitHub issue.
.Parameter Owner
The GitHub username of the account or organization that owns the GitHub repository specified in the -Repository parameter.
.Parameter Repository
Required. The name of the GitHub repository that is ... |
PowerShellCorpus/PowerShellGallery/PSGitHub/0.13.9/Tests/Unit/psgithub.tests.ps1 | psgithub.tests.ps1 | #
# This is a PowerShell Unit Test file.
# You need a unit test framework such as Pester to run PowerShell Unit tests.
# You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084
#
$ModuleRoot = "$($Script:MyInvocation.MyCommand.Path)\..\..\.."
Push-Location `
-Path $ModuleRoot
Get-Module `
... |
PowerShellCorpus/PowerShellGallery/xDSCSEPVIE/2.6.6/Tests/xDSCSEPVIE.Tests.ps1 | xDSCSEPVIE.Tests.ps1 | Import-Module -Name .\DSCResources\xDSCSEPVIE\xDSCSEPVIE.psm1
$Global:DSCModuleName = 'xDSCSEPVIE'
$Global:DSCResourceName = 'xDSCSEPVIE'
InModuleScope -ModuleName xDSCSEPVIE -ScriptBlock {
$VIELocation = 'C:\Temp\doesntmatter.exe'
$global:mockedVolume = [pscustomobject] @{
FileSystemLabel = 'myLabe... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/FailoverClusters.ArgumentCompleters.ps1 | FailoverClusters.ArgumentCompleters.ps1 | # ARGUMENT COMPLETER FUNCTIONS #################################################
# Version 0.97
#CLUSTER
function FailoverClusters_ClusterArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$OptionalDomain = @{}
$Domain = $fakeBoundParameter["Domain"... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Hyper-V.ArgumentCompleters.ps1 | Hyper-V.ArgumentCompleters.ps1 | ## Hyper-V module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -VMName argument to Get-VM
#
function HyperV_VMNameArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$optionalCn = @{}
$cn = $fakeBoundParameter["ComputerName"]
if($cn)
... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Storage.ArgumentCompleters.ps1 | Storage.ArgumentCompleters.ps1 | ## Storage module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -FriendlyName argument to *-PhysicalDisk cmdlets
#
function Storage_PhysicalDiskFriendlyNameParameterCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Storage\Get-PhysicalDisk -FriendlyNa... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Convert-ArgumentCompleterRegistrationScript.ps1 | Convert-ArgumentCompleterRegistrationScript.ps1 |
param(
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory, Position = 0)]
[Alias("PSPath")]
[string]$Path,
[string]$OutputPath
)
process
{
$Path = (Resolve-Path $Path).ProviderPath
if ($null -eq $PSBoundParameters['OutputPath'])
{
$OutputPath = ((Split-Path -Parent $Path) + "\\Tran... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/DnsClient.ArgumentCompleters.ps1 | DnsClient.ArgumentCompleters.ps1 | ## DnsClient module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -InterfaceAlias arguments to DnsClient module cmdlets
#
function DnsClientInterfaceAliasParameterCompleter
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
DnsClient\Get-DnsClient -InterfaceAlias... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/PrintManagement.ArgumentCompleters.ps1 | PrintManagement.ArgumentCompleters.ps1 | #
# .SYNOPSIS
#
# Complete the -Name argument to Printer cmdlets
#
function PrinterNameArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$optionalCn = @{}
$cn = $fakeBoundParameter["ComputerName"]
if($cn)
{
$optionalCn.ComputerNam... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/CimCmdlets.ArgumentCompleters.ps1 | CimCmdlets.ArgumentCompleters.ps1 | ## CimCmdlets module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -QueryDialect argument to CimCmdlets cmdlets
#
function CimInstance_QueryDialectCompleter
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Write-Output CQL WQL | Where-Object {$_ -like "$wordToC... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/RobocopyExe.ArgumentCompleters.ps1 | RobocopyExe.ArgumentCompleters.ps1 |
function RobocopyExeCompletion
{
param($wordToComplete, $commandAst)
#
# .SYNOPSIS
#
# Complete parameters and arguments to Robocopy.exe
#
function Get-RoboCopyArguments {
[PSCustomObject]@{Argument='/S'; ToolTip='copy Subdirectories, but not empty ones'}
... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Appx.ArgumentCompleters.ps1 | Appx.ArgumentCompleters.ps1 | # ARGUMENT COMPLETER FUNCTIONS #################################################
# APPX Package
function Appx_PackageNameArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Appx\Get-AppxPackage -Name "$wordToComplete*" |
Sort-Object -Property Nam... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Hexo.ArgumentCompleters.ps1 | Hexo.ArgumentCompleters.ps1 | function HexoArgumentCompletion{
param($wordToComplete, $commandAst, $cursor)
$HexoCommandList = @('help', 'init', 'version', 'new', 'serve', `
'--debug', '--cwd', '--config', '--draft', '--safe', '--silent')
$HexoCommandList|ForEach-Object {
if("$_" -match "^$wordToCom... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/PowerShellWebAccess.ArgumentCompleters.ps1 | PowerShellWebAccess.ArgumentCompleters.ps1 | ## PowerShellWebAccess module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -RuleName argument to *-PswaAuthorizationRule cmdlets
#
function PowerShellWebAccess_PswaAuthorizationRuleNameParameterCompleter
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
PowerSh... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/ScheduledTasks.ArgumentCompleters.ps1 | ScheduledTasks.ArgumentCompleters.ps1 | #
# .SYNOPSIS
#
# Complete the -TaskName argument to ScheduledTask module cmdlets
#
function ScheduledTaskTaskNameArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Get-ScheduledTask -TaskName "$wordToComplete*" |
Sort-Object TaskName |
... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/NetAdapter.ArgumentCompleters.ps1 | NetAdapter.ArgumentCompleters.ps1 | ## NetAdapter module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -Name argument to commands in NetAdapter module
#
function NetAdapter_AdapterNameArgumentCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
NetAdapter\Get-NetAdapter -Name "$wordToCompl... |
PowerShellCorpus/PowerShellGallery/TabExpansionPlusPlus/1.2/Microsoft.PowerShell.Core.ArgumentCompleters.ps1 | Microsoft.PowerShell.Core.ArgumentCompleters.ps1 |
#
# .SYNOPSIS
#
# Complete the -Parameter argument to Get-Help
#
function HelpParameterNameCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$helpCommandName = $fakeBoundParameter['Name']
if ($helpCommandName)
{
$parameters = (Get-Command -... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.