full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-Type.ps1 | Get-Type.ps1 | function Get-Type {
<#
.SYNOPSIS
Get exported types in the current session
.DESCRIPTION
Get exported types in the current session
.PARAMETER Module
Filter on Module. Accepts wildcard
.PARAMETER Assembly
Filter on Assembly. Accepts wildcard
.PAR... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/New-MrFunction.ps1 | New-MrFunction.ps1 | #Requires -Version 3.0 -Modules Pester
function New-MrFunction {
<#
.SYNOPSIS
Creates a new PowerShell function in the specified location.
.DESCRIPTION
New-MrFunction is an advanced function that creates a new PowerShell function in the
specified location including creating a Pester test for the... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Invoke-MrPesterToSpeech.ps1 | Invoke-MrPesterToSpeech.ps1 | #Requires -Version 3.0 -Modules Pester
function Invoke-MrPesterToSpeech {
[CmdletBinding()]
param (
[switch]$Quiet
)
$Params = @{}
if ($PSBoundParameters.Quiet) {
$Params.Quiet = $true
}
$Results = Invoke-Pester -PassThru @Params |
Select-Object -ExpandProp... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-MrURL.ps1 | Test-MrURL.ps1 | #Requires -Version 3.0
function Test-MrURL {
[CmdletBinding()]
param (
[string]$Uri,
[switch]$Detailed
)
$CurrentErrorAction = $ErrorActionPreference
$ErrorActionPreference = 'SilentlyContinue'
$Result = Invoke-WebRequest -Uri $Uri -TimeoutSec 30
$ErrorActionPr... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Expand-MrZipFile.ps1 | Expand-MrZipFile.ps1 | function Expand-MrZipFile {
<#
.SYNOPSIS
Expand-MrZipFile is a function which extracts the contents of a zip file.
.DESCRIPTION
Expand-MrZipFile is a function which extracts the contents of a zip file specified via the -File parameter to the
location specified via the -Destination parameter. This fu... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Restart-MrServiceOrDie.ps1 | Restart-MrServiceOrDie.ps1 | #Requires -Version 2.0
function Restart-MrServiceOrDie {
<#
.SYNOPSIS
Restarts one or more Windows services.
.DESCRIPTION
Restart-MrServiceOrDie is an advanced function that is designed to restart one
or more services even if they hang with a status of stop pending.
.PARAMETER ComputerName
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrEsetUpdateVersion.ps1 | Get-MrEsetUpdateVersion.ps1 | function Get-MrEsetUpdateVersion {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName = $env:COMPUTERNAME,
[System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty
)
$Params = @{}
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/ConvertTo-MrHashtable.ps1 | ConvertTo-MrHashtable.ps1 | function ConvertTo-MrHashTable {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
[PSObject[]]$Object
)
PROCESS {
foreach ($o in $Object) {
$hashtable = @{}
foreach ($p in Get-Member -InputObjec... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrUptime.ps1 | Get-MrUptime.ps1 | #Requires -Version 3.0
function Get-MrUptime {
<#
.SYNOPSIS
Returns the uptime for the specified computer(s).
.DESCRIPTION
Get-MrUptime is an advanced function that retrieves the uptime for one or more
computers that are specified via a CIM session.
.PARAMETER CimSession
The previously ... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrSavedCredential.ps1 | Get-MrSavedCredential.ps1 | #Requires -Version 3.0
function Get-MrSavedCredential {
[CmdletBinding()]
param (
[ValidateScript({
If ($_ -notmatch '^\/') {
$True
}
else {
Throw "$_ is not valid. Target cannot begin with a forward slash."
}
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrAutoService.ps1 | Get-MrAutoService.ps1 | function Get-MrAutoService {
<#
.SYNOPSIS
Returns a list of services that are set to start automatically, excluding the
services that are set to delayed start.
.DESCRIPTION
Get-MrAutoService is a function that returns a list of services from
the specified remote computer(s) that are set ... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-MrVMBackupRequirement.ps1 | Test-MrVMBackupRequirement.ps1 | #Requires -Version 3.0 -Modules Pester
function Test-MrVMBackupRequirement {
<#
.SYNOPSIS
Tests the requirements for live backups of a Hyper-V Guest VM for use with Altaro VM Backup.
.DESCRIPTION
Test the requirements for live backups of a Hyper-V Guest VM as defined in this Altaro support article:
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/profile.ps1 | profile.ps1 | Set-Location -Path $env:SystemDrive\
Clear-Host
$Error.Clear()
Import-Module -Name posh-git -ErrorAction SilentlyContinue
if (-not($Error[0])) {
$DefaultTitle = $Host.UI.RawUI.WindowTitle
$GitPromptSettings.BeforeText = '('
$GitPromptSettings.BeforeForegroundColor = [ConsoleColor]::Cyan
$Git... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrExceptionType.ps1 | Get-MrExceptionType.ps1 | function Get-MrExceptionType {
[CmdletBinding()]
param (
[ValidateRange(1,256)]
[int]$Count = 1
)
if ($Error.Count -ge 1) {
if ($Count -gt $Error.Count) {
$Count = $Error.Count
}
for ($i = 0; $i -lt $Count; $i++) {
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrPipelineInput.ps1 | Get-MrPipelineInput.ps1 | #Requires -Version 3.0
function Get-MrPipelineInput {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$Name,
[System.Management.Automation.WhereOperatorSelectionMode]$Option = 'Default',
[ValidateRange(1,2147483647)]
[int]$Records = 21... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Start-MrAutoStoppedService.ps1 | Start-MrAutoStoppedService.ps1 | #Requires -Version 3.0
function Start-MrAutoStoppedService {
<#
.SYNOPSIS
Starts services that are set to start automatically, are not currently running,
excluding the services that are set to delayed start.
.DESCRIPTION
Start-MrAutoStoppedService is a function that starts services on the sp... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrVmHost.ps1 | Get-MrVmHost.ps1 | #Requires -Version 3.0
function Get-MrVmHost {
<#
.SYNOPSIS
Determines the HyperV host virtualization server for the specified virtual machines.
.DESCRIPTION
Get-MrVmHost is an advanced function for determining the HyperV host virtualiztion server for one
or more VMs (virtual machines).
.PAR... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrGitStatus.ps1 | Get-MrGitStatus.ps1 | #Requires -Version 4.0 -Modules Posh-Git
function Get-MrGitStatus {
[CmdletBinding()]
param ()
$Location = Get-Location
if (Get-GitDirectory) {
$Repository = Split-Path -Path (git rev-parse --show-toplevel) -Leaf
}
else {
throw "$Location is not part of a Git repsoitor... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrGeoInformation.ps1 | Get-MrGeoInformation.ps1 | #Requires -Version 3.0
function Get-MrGeoInformation {
<#
.SYNOPSIS
Queries ip-api.com for Geolocation information based on IP Address.
.DESCRIPTION
Get-MrGeoInformation is a PowerShell function that is designed to query
ip-api.com (free for non-commercial use) for Geolocation information for on... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Invoke-MrTDDWorkflow.ps1 | Invoke-MrTDDWorkflow.ps1 | #Requires -Version 4.0 -Modules Pester
function Invoke-MrTDDWorkflow {
[CmdletBinding()]
param (
[ValidateScript({
If (Test-Path -Path $_ -PathType Container) {
$true
}
else {
Throw "'$_' is not a valid directory."
}
})... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrParameterAlias.ps1 | Get-MrParameterAlias.ps1 | #Requires -Version 3.0
function Get-MrParameterAlias {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$Name
)
(Get-Command -Name $Name).Parameters.Values |
Where-Object Aliases |
Select-Object -Property Name, Aliases
} |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrFunctionsToExport.ps1 | Get-MrFunctionsToExport.ps1 | function Get-MrFunctionsToExport {
<#
.SYNOPSIS
Returns a list of functions in the specified directory.
.DESCRIPTION
Get-MrFunctionsToExport is an advanced function which returns a list of functions
that are each contained in single quotes and each separated by a comma unless the
simple para... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Out-MrReverseString.ps1 | Out-MrReverseString.ps1 | #Requires -Version 3.0
function Out-MrReverseString {
<#
.SYNOPSIS
Reverse the characters for one or more strings.
.DESCRIPTION
Out-MrReverseString is a PowerShell function that reverses or flips the content in
one or more strings.
.PARAMETER String
The content to be reversed. Mandator... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrVHDChain.ps1 | Get-MrVHDChain.ps1 | #Requires -Version 3.0 -Modules Hyper-V
function Get-MrVHDChain {
[CmdletBinding()]
param(
[string]$ComputerName = $env:COMPUTERNAME,
[string[]]$Name = '*'
)
try {
$VMs = Get-VM -ComputerName $ComputerName -Name $Name -ErrorAction Stop
}
catch {
Write-W... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Out-MrSpeech.ps1 | Out-MrSpeech.ps1 | function Out-MrSpeech {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
[string]$Phrase
)
Add-Type -AssemblyName System.Speech
$voice = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$voice.Speak($Phrase)
} |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrAvailableDriveLetter.ps1 | Get-MrAvailableDriveLetter.ps1 | #Requires -Version 2.0
function Get-MrAvailableDriveLetter {
<#
.SYNOPSIS
Returns one or more available drive letters.
.DESCRIPTION
Get-MrAvailableDriveLetter is an advanced PowerShell function that returns one or more available
drive letters depending on the specified parameters.
.PARAMETER... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MSPSUGMeetingDate.ps1 | Get-MSPSUGMeetingDate.ps1 | #Requires -Version 3.0
function Get-MSPSUGMeetingDate {
<#
.SYNOPSIS
Returns the meeting dates for the Mississippi PowerShell User Group.
.DESCRIPTION
Get-MSPSUGMeetingDate is a function that returns the dates when
the Mississippi PowerShell User Group meetings are held.
.PARAMETER Month
The mo... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Remove-MrSavedCredential.ps1 | Remove-MrSavedCredential.ps1 | #Requires -Version 3.0
function Remove-MrSavedCredential {
[CmdletBinding(SupportsShouldProcess,
ConfirmImpact='Medium')]
param (
[Parameter(Mandatory,
ValueFromPipelineByPropertyName)]
[string]$Target
)
PROCESS {
if ($PSCmdlet.... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/New-MrCimSession.ps1 | New-MrCimSession.ps1 | #Requires -Version 3.0
function New-MrCimSession {
<#
.SYNOPSIS
Creates CimSessions to remote computer(s), automatically determining if the WSMAN
or Dcom protocol should be used.
.DESCRIPTION
New-MrCimSession is a function that is designed to create CimSessions to one or more
computers, automati... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-ConsoleColor.ps1 | Test-ConsoleColor.ps1 | #Requires -Version 3.0 -Modules Pscx
function Test-ConsoleColor {
<#
.SYNOPSIS
Tests all the different color combinations for the PowerShell console.
.DESCRIPTION
Test-ConsoleColor is a PowerShell function that by default iterates through
all of the possible color combinations for the PowerShell... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Microsoft.PowerShell_profile.ps1 | Microsoft.PowerShell_profile.ps1 | $Global:ProgressPreference = 'SilentlyContinue'
if (Test-NetConnection -ComputerName bing.com -Port 80 -InformationLevel Quiet -ErrorAction SilentlyContinue -WarningAction SilentlyContinue) {
$Now = Get-Date
$Date = Get-Date -Month $Now.Month -Day 1
while ($Date.DayOfWeek -ne 'Tuesday') {$Date... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrHash.ps1 | Get-MrHash.ps1 | function Get-MrHash {
[CmdletBinding()]
param (
[string]$String,
[ValidateSet('MD5', 'SHA1')]
[string]$Algorithm = 'MD5'
)
Add-Type -AssemblyName System.Web
[System.Web.Security.FormsAuthentication]::HashPasswordForStoringInConfigFile($String, $Alg... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Update-MrGitRepository.ps1 | Update-MrGitRepository.ps1 | #Requires -Version 4.0 -Modules Posh-Git
function Update-MrGitRepository {
[CmdletBinding(SupportsShouldProcess,
ConfirmImpact='Medium')]
param ()
$Location = Get-Location
if (Get-GitDirectory) {
$Repository = Split-Path -Path (git.exe rev-parse --show-toplevel) -... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Microsoft.PowerShellISE_profile.ps1 | Microsoft.PowerShellISE_profile.ps1 | $psISE.Options.Zoom = 100 |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Stop-MrPendingService.ps1 | Stop-MrPendingService.ps1 | function Stop-MrPendingService {
<#
.SYNOPSIS
Stops one or more services that is in a state of 'stop pending'.
.DESCRIPTION
Stop-MrPendingService is a function that is designed to stop any service
that is hung in the 'stop pending' state. This is accomplished by forcibly
stopping the hung... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-MrFunctionsToExport.ps1 | Test-MrFunctionsToExport.ps1 | #Requires -Version 3.0 -Modules Pester
function Test-MrFunctionsToExport {
<#
.SYNOPSIS
Tests that all functions in a module are being exported.
.DESCRIPTION
Test-MrFunctionsToExport is an advanced function that runs a Pester test against
one or more modules to validate that all functions are be... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/New-MrPlanetPowerShellAuthor.ps1 | New-MrPlanetPowerShellAuthor.ps1 | #Requires -Version 3.0
function New-MrPlanetPowerShellAuthor {
<#
.SYNOPSIS
Creates the author information required to add your PowerShell related blog to Planet PowerShell.
.DESCRIPTION
New-MrPlanetPowerShellAuthor is an advanced function that creates the author information required
to add your... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-Port.ps1 | Test-Port.ps1 | function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
.PARAMETER port
Port to test
.PARAMETER tcp
Use tcp port
.PARAMETE... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrLeapYear.ps1 | Get-MrLeapYear.ps1 | function Get-MrLeapYear {
<#
.SYNOPSIS
Get-MrLeapYear is used to determine whether or not a specific year is a leap year.
.DESCRIPTION
Get-LeapYear is a function that is used to determine whether or not the specified
year(s) are leap years. Contrary to popular belief, leap year does not occur every
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Test-MrIpAddress.ps1 | Test-MrIpAddress.ps1 | #Requires -Version 2.0
function Test-MrIpAddress {
<#
.SYNOPSIS
Tests one or more IP Addresses to determine if they are valid.
.DESCRIPTION
Test-MrIpAddress is an advanced function that tests one or more IP Addresses to determine if
they are valid. The detailed parameter can be used to return ad... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Get-MrScheduledTask.ps1 | Get-MrScheduledTask.ps1 | #Requires -Version 3.0
function Get-MrScheduledTask {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName,
[string]$TaskName,
[System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty
... |
PowerShellCorpus/PowerShellGallery/MrToolkit/1.2/Private/Test-MrFileLock.ps1 | Test-MrFileLock.ps1 | function Test-MrFileLock {
[CmdletBinding()]
param (
[ValidateScript({
If (Test-Path -Path $_ -PathType Leaf) {
$True
}
else {
Throw "'$($_ -replace '^.*\\')' is not a valid file."
}
})]
[string]$Path
)
... |
PowerShellCorpus/PowerShellGallery/ADAudit/1.1/ActiveDirectory.tests.ps1 | ActiveDirectory.tests.ps1 | [CmdletBinding()]
Param(
[string]$ADFile,
[string]$ADGoldFile = $(Get-ChildItem ("ADGoldConfig-*.xml") | Select name -last 1).name
)
#Try to load the Active Directory configuration files for comparison
Try{
If ($ADFile) {
Write-Verbose "Loading the AD Snapshot from: $ADFile"
$ADSn... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/tests/Start-DSCEAScan.tests.ps1 | Start-DSCEAScan.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. "$here\..\functions\$sut"
Describe $sut {
It 'Should default to .\localhost.mof' {
}
It 'Should be able to accept a relative path MOF' {
}
It 'Should be able ... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/configs/SampleConfigWithScriptResource.ps1 | SampleConfigWithScriptResource.ps1 | configuration ScriptResourceSample {
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node 'localhost' {
#Disables RDP
Script 'ScriptResourceOne' {
GetScript = {
@{
Results = (Get-NetFirewallRule -DisplayGroup 'Remote Desktop').En... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/configs/SampleConfig.ps1 | SampleConfig.ps1 | configuration MemberServerSecuritySettings {
param([string[]]$ComputerName='localhost')
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node $ComputerName {
#Anti-Malware
Service 'MicrosoftAntimalwareService' {
Name = 'MsMpSvc'
StartupType ... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/configs/SampleConfigWithExternalResource.ps1 | SampleConfigWithExternalResource.ps1 | configuration MemberServerSecuritySettings {
param([string[]]$ComputerName='localhost')
Import-DscResource -ModuleName PSDesiredStateConfiguration,xSMBShare
Node $ComputerName {
#Anti-Malware
Service 'MicrosoftAntimalwareService' {
Name = 'MsMpSvc'
St... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Copy-DSCResource.ps1 | Copy-DSCResource.ps1 | function Copy-DSCResource {
[cmdletBinding()]
Param($PSSession,$ModulestoCopy)
foreach ($Module in $ModulestoCopy)
{
$Source = 'C:\Program Files\WindowsPowerShell\Modules\'+$Module.ModuleName
Write-Verbose "Module location: $Source"
$Destination = 'C:\Program Files\WindowsPo... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Send-DSCEACSVtoSQL.ps1 | Send-DSCEACSVtoSQL.ps1 | #The function below was inspired by Chrissy LeMaire's post at https://blog.netnerds.net/2015/01/powershell-high-performance-techniques-for-importing-csv-to-sql-server/
function Send-DSCEACSVtoSQL {
param(
[Parameter(Mandatory=$true)][string]$SQLserver,
[Parameter(Mandatory=$true)][string]$DatabaseN... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Start-DSCEAscan.ps1 | Start-DSCEAscan.ps1 | function Start-DSCEAscan {
<#
.SYNOPSIS
Will run Test-DscConfiguration -ReferenceConfiguration using the provided MOF file against the remote systems supplied and saves the scan results to a XML file
.DESCRIPTION
Run this function after you have defined the remote systems to scan and have created a MOF file tha... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Get-DSCEAreport.ps1 | Get-DSCEAreport.ps1 | function Get-DSCEAreport {
<#
.SYNOPSIS
Generates a HTML based report after Start-DSCEAscan has been run
.DESCRIPTION
Used to create viewable reports after Start-DSCEAscan has created a results.xml file which will be parsed.
.PARAMETER ItemName
Switch parameter - This is the item name from the configuration f... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Repair-DSCEngine.ps1 | Repair-DSCEngine.ps1 | function Repair-DSCEngine {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName
)
#kill the dsc processes on the remote system
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
### find the process that is hosting the DSC engine
$dscProc... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Convert-DSCEAresultsToCSV.ps1 | Convert-DSCEAresultsToCSV.ps1 | function Convert-DSCEAresultsToCSV {
<#
.SYNOPSIS
Creates CSV data file from DSCEA results
.DESCRIPTION
Used to convert the raw XML output from a DSCEA scan to a more consumable format of CSV
.PARAMETER InputXML
The file name (full file path) of the XML file you would like to convert to CSV. If one is not pro... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Get-MOFRequiredModules.ps1 | Get-MOFRequiredModules.ps1 | function Get-MOFRequiredModules {
[CmdletBinding()]
Param($mofFile)
$DSCResources = Get-DscResource
$DScModuleArray = @()
$ModulesToCopy = @()
foreach ($Resource in $DscResources)
{
if (!(($Resource.ModuleName -eq "PSDesiredStateConfiguration") -or ($Resource.ImplementedAs -eq 'Bin... |
PowerShellCorpus/PowerShellGallery/DSCEA/1.2.0.0/functions/Out-DataTable.ps1 | Out-DataTable.ps1 | #######################
function Get-Type {
param($type)
$types = @(
'System.Boolean',
'System.Byte[]',
'System.Byte',
'System.Char',
'System.Datetime',
'System.Decimal',
'System.Double',
'System.Guid',
'System.Int16',
'System.Int32',
'System.Int64',
'System.Single',
'System.UInt16',
'System.UInt32',
'System.UInt6... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/Export-StepTemplate.ps1 | Export-StepTemplate.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/New-ScriptValidationTest.ps1 | New-ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/Invoke-OctopusScriptTestSuite.ps1 | Invoke-OctopusScriptTestSuite.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/New-ScriptModule.ps1 | New-ScriptModule.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/New-StepTemplate.ps1 | New-StepTemplate.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/Invoke-TeamCityCiUpload.ps1 | Invoke-TeamCityCiUpload.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/Sync-StepTemplate.ps1 | Sync-StepTemplate.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Interface/Sync-ScriptModule.ps1 | Sync-ScriptModule.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/PowerShellManipulation/Get-VariableFromScriptFile.ps1 | Get-VariableFromScriptFile.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/PowerShellManipulation/Get-ScriptBody.ps1 | Get-ScriptBody.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/PowerShellManipulation/Get-VariableStatement.ps1 | Get-VariableStatement.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/TeamCity/Write-TeamCityMessage.ps1 | Write-TeamCityMessage.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/TeamCity/Reset-BuildOutputDirectory.ps1 | Reset-BuildOutputDirectory.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/Reset-Cache.ps1 | Reset-Cache.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/Get-Cache.ps1 | Get-Cache.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/Test-OctopusConnectivity.ps1 | Test-OctopusConnectivity.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/Invoke-OctopusOperation.ps1 | Invoke-OctopusOperation.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/Convert-ToOctopusJson.ps1 | Convert-ToOctopusJson.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/ScriptModules/New-ScriptModuleVariableSetObject.ps1 | New-ScriptModuleVariableSetObject.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/ScriptModules/New-ScriptModuleObject.ps1 | New-ScriptModuleObject.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/StepTemplates/New-StepTemplateObject.ps1 | New-StepTemplateObject.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/StepTemplates/Compare-Hashtable.ps1 | Compare-Hashtable.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/StepTemplates/Convert-PSObjectToHashTable.ps1 | Convert-PSObjectToHashTable.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Octopus/StepTemplates/Compare-StepTemplate.ps1 | Compare-StepTemplate.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Tests/Get-ScriptValidationTestsPath.ps1 | Get-ScriptValidationTestsPath.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Tests/Update-XPathValue.ps1 | Update-XPathValue.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/Cmdlets/Internal/Tests/Invoke-PesterForTeamCity.ps1 | Invoke-PesterForTeamCity.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/ScriptValidationTests/Generic/PSScriptAnalyzer.ScriptValidationTest.ps1 | PSScriptAnalyzer.ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/ScriptValidationTests/Generic/FileFormat.ScriptValidationTest.ps1 | FileFormat.ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/ScriptValidationTests/Generic/TestNaming.ScriptValidationTest.ps1 | TestNaming.ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/ScriptValidationTests/ScriptModules/Parameters.ScriptValidationTest.ps1 | Parameters.ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/OctopusStepTemplateCi/1.1.29/ScriptValidationTests/StepTemplates/Parameters.ScriptValidationTest.ps1 | Parameters.ScriptValidationTest.ps1 | <#
Copyright 2016 ASOS.com Limited
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
PowerShellCorpus/PowerShellGallery/CountriesPS/1.0.0.0/Public/Get-Country.ps1 | Get-Country.ps1 | function Get-Country
{
<#
.SYNOPSIS
function to retrieve information about one or more countries
.DESCRIPTION
function to retrieve information about one or more countries
.PARAMETER CountryCode
Specifies one or multiple country codes
.PARAMETER Name
Specifies the name of the country
.PARAMETER Ca... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/install.ps1 | install.ps1 | [CmdletBinding()]
param (
[string]$Path,
[switch]$Beta
)
try {
Update-Module dbatools -Erroraction Stop
Write-Output "Updated using the PowerShell Gallery"
return
}
catch {
Write-Output "dbatools was not installed by the PowerShell Gallery, continuing with web install."
}
$module = Import-Module ... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/optional/TabExpansionPlusPlus.ps1 | TabExpansionPlusPlus.ps1 | if (-not (Get-Command -Name Register-ArgumentCompleter -ErrorAction Ignore))
{
#############################################################################
#
# TabExpansionPlusPlus
#
#
<#
Copyright (c) 2013, Jason Shirk
All rights reserved.
Redistribution and use in source a... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/optional/Get-GenericArgumentCompleter.ps1 | Get-GenericArgumentCompleter.ps1 | if (-not (Get-Command -Name Register-ArgumentCompleter -ErrorAction Ignore))
{
Function Get-GenericArgumentCompleter
{
param (
[string]$name,
[object]$collection
)
Register-ArgumentCompleter -ParameterName $name -ScriptBlock {
param (
$commandName,
$parameterName,
$wordToComplete,
$... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/optional/Invoke-SqlCmd2.ps1 | Invoke-SqlCmd2.ps1 | function Invoke-Sqlcmd2
{
<#
.SYNOPSIS
Runs a T-SQL script.
.DESCRIPTION
Runs a T-SQL script. Invoke-Sqlcmd2 runs the whole scipt and only captures the first selected result set, such as the output of PRINT statements when -verbose parameter is specified.
Paramaterized queri... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Get-DbaPagefileSetting.Tests.ps1 | Get-DbaPagefileSetting.Tests.ps1 | #Thank you Warren http://ramblingcookiemonster.github.io/Testing-DSC-with-Pester-and-AppVeyor/
if(-not $PSScriptRoot)
{
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$Verbose = @{}
if($env:APPVEYOR_REPO_BRANCH -and $env:APPVEYOR_REPO_BRANCH -notlike "master")
{
$Verbose.add("Verbos... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Get-DbaAgentJobOutputFile.Tests.ps1 | Get-DbaAgentJobOutputFile.Tests.ps1 | #Thank you Warren http://ramblingcookiemonster.github.io/Testing-DSC-with-Pester-and-AppVeyor/
if(-not $PSScriptRoot)
{
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$Verbose = @{}
if($env:APPVEYOR_REPO_BRANCH -and $env:APPVEYOR_REPO_BRANCH -notlike "master")
{
$Verbose.add("Verbos... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Remove-SQLDatabaseSafely.Tests.ps1 | Remove-SQLDatabaseSafely.Tests.ps1 | #Thank you Warren http://ramblingcookiemonster.github.io/Testing-DSC-with-Pester-and-AppVeyor/
if(-not $PSScriptRoot)
{
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$Verbose = @{}
if($env:APPVEYOR_REPO_BRANCH -and $env:APPVEYOR_REPO_BRANCH -notlike "master")
{
$Verbose.add("Verbos... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Get-DbaMaxMemory.Tests.ps1 | Get-DbaMaxMemory.Tests.ps1 | ## Thank you Warren http://ramblingcookiemonster.github.io/Testing-DSC-with-Pester-and-AppVeyor/
if(-not $PSScriptRoot) {
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$Verbose = @{}
if($env:APPVEYOR_REPO_BRANCH -and $env:APPVEYOR_REPO_BRANCH -notlike "master") {
$Verbose.add("Verb... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Get-OlaHRestoreFile.Tests.ps1 | Get-OlaHRestoreFile.Tests.ps1 | #Thank you Warren http://ramblingcookiemonster.github.io/Testing-DSC-with-Pester-and-AppVeyor/
if(-not $PSScriptRoot)
{
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$Verbose = @{}
if($env:APPVEYOR_REPO_BRANCH -and $env:APPVEYOR_REPO_BRANCH -notlike "master")
{
$Verbose.add("Verbos... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/dbatools.Tests.ps1 | dbatools.Tests.ps1 | $Path = Split-Path -Parent $MyInvocation.MyCommand.Path
$ModulePath = (get-item $Path ).parent.FullName
$ModuleName = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -Replace ".Tests.ps1"
$ManifestPath = "$ModulePath\$ModuleName.psd1"
# test the module manifest - exports the right functions, processes the rig... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Export-SqlUser.Tests.ps1 | Export-SqlUser.Tests.ps1 | ## This is a template file for the ScriptAnalyser tests for each command.
## It Should be named $CommandName.Tests.ps1 the capital T is important as is the . !!
## The help will be analysed via the inModuleHelp.Tests.ps1 file so you dont need to worry about that.
## Add you own functional tests to the end of this fi... |
PowerShellCorpus/PowerShellGallery/dbatools/0.8.957/tests/Remove-SqlOrphanUser.Tests.ps1 | Remove-SqlOrphanUser.Tests.ps1 | ## This is a template file for the ScriptAnalyser tests for each command.
## It Should be named $CommandName.Tests.ps1 the capital T is important as is the . !!
## The help will be analysed via the inModuleHelp.Tests.ps1 file so you dont need to worry about that.
## Add you own functional tests to the end of this fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.