full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/PSExcel/1.0.2/New-Excel.ps1 | New-Excel.ps1 | function New-Excel {
<#
.SYNOPSIS
Create an OfficeOpenXml ExcelPackage to work with
.DESCRIPTION
Create an OfficeOpenXml ExcelPackage to work with
.PARAMETER Path
Path to an xlsx file to open
.EXAMPLE
$Excel = New-Excel -Path "C:\Excel.xlsx"
... |
PowerShellCorpus/PowerShellGallery/PSExcel/1.0.2/Get-CellValue.ps1 | Get-CellValue.ps1 | function Get-CellValue {
<#
.SYNOPSIS
Get cell data from Excel
.DESCRIPTION
Get cell data from Excel
.PARAMETER Path
Path to an xlsx file to get cells from
.PARAMETER Excel
An ExcelPackage to get cells from
.PARAMETER WorkSheet
An Excel ... |
PowerShellCorpus/PowerShellGallery/PSExcel/1.0.2/Close-Excel.ps1 | Close-Excel.ps1 | function Close-Excel {
<#
.SYNOPSIS
Close an OfficeOpenXml ExcelPackage
.DESCRIPTION
Close an OfficeOpenXml ExcelPackage
.PARAMETER Excel
An ExcelPackage object to close
.PARAMETER Save
Save the ExcelPackage before closing
.PARAMETER Path
... |
PowerShellCorpus/PowerShellGallery/PSExcel/1.0.2/Set-CellValue.ps1 | Set-CellValue.ps1 | function Set-CellValue {
<#
.SYNOPSIS
Set the value of a specific cell or range
.DESCRIPTION
Set the value of a specific cell or range
NOTE:
Each time you call this function, you need to save and re-create your Excel Object.
If you attempt to modif... |
PowerShellCorpus/PowerShellGallery/PSExcel/1.0.2/Join-Object.ps1 | Join-Object.ps1 | function Join-Object
{
<#
.SYNOPSIS
Join data from two sets of objects based on a common value
.DESCRIPTION
Join data from two sets of objects based on a common value
For more details, see the accompanying blog post:
http://ramblingcookiemonster.github.io/Join... |
PowerShellCorpus/PowerShellGallery/GitUtils/0.6.0/GitUtils.pre.ps1 | GitUtils.pre.ps1 | if ((Get-Command "git" -ErrorAction SilentlyContinue) -eq $null)
{
throw "Error: Git not available. Please install git and add it to your path."
} |
PowerShellCorpus/PowerShellGallery/1Poshword/1.0.0/lib.ps1 | lib.ps1 | ################
# Shared helpers
################
function epoch([uint64] $Seconds) {
(New-Object DateTime @(1970,1,1,0,0,0,0,'Utc')).AddSeconds($seconds).ToLocalTime()
}
function SecureString2String([SecureString] $ss) {
(New-Object PSCredential @('xyz', $ss)).GetNetworkCredential().Password
}
function Clip... |
PowerShellCorpus/PowerShellGallery/OVF.Active.Directory/1.0.0/Diagnostics/Simple/active.directory.tests.ps1 | active.directory.tests.ps1 | #require -modules poshspec
Import-Module -Name poshspec -Verbose:$false -ErrorAction Stop
describe 'DNS' {
context 'Availability' {
service DNS status { should be running }
service Dnscache status { should be running }
TcpPort localhost 53 TcpTestSucceeded { Should Be $true } ... |
PowerShellCorpus/PowerShellGallery/Azure.AnalysisServices/0.4.0/AnalysisServicesDataplaneStartup.ps1 | AnalysisServicesDataplaneStartup.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
PowerShellCorpus/PowerShellGallery/Azure.AnalysisServices/0.2.0/AnalysisServicesDataplaneStartup.ps1 | AnalysisServicesDataplaneStartup.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/GetUsingVariableValues.ps1 | GetUsingVariableValues.ps1 | Function GetUsingVariableValues {
Param ([System.Management.Automation.Language.UsingExpressionAst[]]$UsingVar)
$UsingVar = $UsingVar | Group-Object SubExpression | ForEach-Object {$_.Group | Select-Object -First 1}
ForEach ($Var in $UsingVar) {
Try {
$Value = ($PSCmdlet.SessionS... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/RegisterScriptScopeFunction.ps1 | RegisterScriptScopeFunction.ps1 | Function RegisterScriptScopeFunction {
[cmdletbinding()]
Param (
[parameter()]
[string[]]$Name
)
$FoundName = @()
Write-Verbose "Getting callstacks"
$PSCallStack = Get-PSCallStack
Write-Verbose "PSCallStacks: `n$($PSCallStack|Out-String)"
If ($PSCallStack.count -gt 1)... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/SetIsReceived.ps1 | SetIsReceived.ps1 | Function SetIsReceived {
Param (
[parameter(ValueFromPipeline=$True)]
[rsjob]$RSJob,
[switch]$SetTrue
)
Begin{
$Flags = 'nonpublic','instance','static'
}
Process {
If ($PSVersionTable['PSEdition'] -and $PSVersionTable.PSEdition -eq 'Core') {
$R... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/Increment.ps1 | Increment.ps1 | Function Increment {
Write-Verbose "Incrementing job ID"
Set-Variable -Name PoshRS_JobId -Value ($PoshRS_JobId + 1) -Force -Scope Global
Write-Output $PoshRS_JobId
} |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/ConvertScript.ps1 | ConvertScript.ps1 | Function ConvertScript {
Param (
[scriptblock]$ScriptBlock
)
$UsingVariables = @(GetUsingVariables -ScriptBlock $ScriptBlock)
$List = New-Object 'System.Collections.Generic.List`1[System.Management.Automation.Language.VariableExpressionAst]'
$Params = New-Object System.Collections.ArrayList
... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/ConvertScriptBlockV2.ps1 | ConvertScriptBlockV2.ps1 | Function ConvertScriptBlockV2 {
Param (
[scriptblock]$ScriptBlock,
$UsingVariable,
$UsingVariableValue
)
$UsingVariables = $UsingVariable
$UsingVariable = $UsingVariableValue
$errors = [System.Management.Automation.PSParseError[]] @()
$Tokens = [Management.Automa... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/IsExistingParamBlock.ps1 | IsExistingParamBlock.ps1 | Function IsExistingParamBlock {
Param([scriptblock]$ScriptBlock)
$errors = [System.Management.Automation.PSParseError[]] @()
$Tokens = [Management.Automation.PsParser]::Tokenize($ScriptBlock.tostring(), [ref] $errors)
$Finding=$True
For ($i=0;$i -lt $Tokens.count; $i++) {
If ($... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/WriteStream.ps1 | WriteStream.ps1 | Function WriteStream {
[CmdletBinding()]
Param (
[Parameter(ValueFromPipeline=$true)]
[Object]$IndividualJob
)
Begin {
$Streams = "Verbose","Warning","Error","Output","Debug"
}
Process {
ForEach ($Stream in $Streams)
{
If (($IndividualJob.$Str... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/GetUsingVariables.ps1 | GetUsingVariables.ps1 | Function GetUsingVariables {
Param ([scriptblock]$ScriptBlock)
$ScriptBlock.ast.FindAll({$args[0] -is [System.Management.Automation.Language.UsingExpressionAst]},$True)
} |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/FindFunction.ps1 | FindFunction.ps1 | #Helper function
Function FindFunction {
[CmdletBinding()]
param (
[string]$ScriptBlock
)
#Just in case we have some oddness going on
$ScriptBlock = $ScriptBlock -replace '`','``'
# Tokenize the script
$tokens = [Management.Automation.PSParser]::Tokenize($ScriptBlock, [ref]$null... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/GetUsingVariablesV2.ps1 | GetUsingVariablesV2.ps1 | Function GetUsingVariablesV2 {
Param ([scriptblock]$ScriptBlock)
$errors = [System.Management.Automation.PSParseError[]] @()
$Results = [Management.Automation.PsParser]::Tokenize($ScriptBlock.tostring(), [ref] $errors)
$Results | Where-Object {
$_.Content -match '^Using:' -AND $_.Type -eq 'Varia... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Private/GetParamVariable.ps1 | GetParamVariable.ps1 | Function GetParamVariable {
[CmdletBinding()]
param (
[scriptblock]$ScriptBlock
)
# Tokenize the script
[array] $tokens = [Management.Automation.PSParser]::Tokenize($ScriptBlock, [ref]$null) | Where-Object {
$_.Type -ne 'NewLine'
}
# First Pass - Grab all tokens between... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Start-RSJob.ps1 | Start-RSJob.ps1 | Function Start-RSJob {
<#
.SYNOPSIS
Starts a background job using runspaces.
.DESCRIPTION
This will run a command in the background, leaving your console available to perform other tasks. This uses
runspaces in runspacepools which allows for throttling of running... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Receive-RSJob.ps1 | Receive-RSJob.ps1 | Function Receive-RSJob {
<#
.SYNOPSIS
Gets the results of the Windows PowerShell runspace jobs in the current session.
.DESCRIPTION
Gets the results of the Windows PowerShell runspace jobs in the current session. You can use
Get-RSJob and pipe the results into th... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Remove-RSJob.ps1 | Remove-RSJob.ps1 | Function Remove-RSJob {
<#
.SYNOPSIS
Deletes a Windows PowerShell runspace job.
.DESCRIPTION
Deletes a Windows PowerShell background job that has been started using Start-RSJob
.PARAMETER Name
The name of the jobs to remove..
.PARAMETER ID
... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Stop-RSJob.ps1 | Stop-RSJob.ps1 | Function Stop-RSJob {
<#
.SYNOPSIS
Stops a Windows PowerShell runspace job.
.DESCRIPTION
Stops a Windows PowerShell background job that has been started using Start-RSJob
.PARAMETER Name
The name of the jobs to stop..
.PARAMETER ID
T... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Wait-RSJob.ps1 | Wait-RSJob.ps1 | Function Wait-RSJob {
<#
.SYNOPSIS
Waits until all RSJobs are in one of the following states:
.DESCRIPTION
Waits until all RSJobs are in one of the following states:
.PARAMETER Name
The name of the jobs to query for.
.PARAMETER ID
T... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Public/Get-RSJob.ps1 | Get-RSJob.ps1 | Function Get-RSJob {
<#
.SYNOPSIS
Gets runspace jobs that are currently available in the session.
.DESCRIPTION
Get-RSJob will display all jobs that are currently available to include completed and currently running jobs.
If no parameters are given, all jobs are d... |
PowerShellCorpus/PowerShellGallery/PoshRSJob/1.7.3.9/Scripts/TabExpansion.ps1 | TabExpansion.ps1 | #region Custom Argument Completors
#Global variables are required for this functionality (Invoke-ScriptAnalyzer)
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidGlobalVars", "global:options")]
param()
#region Job ID
$completion_ID = {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fa... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/Examples/cAppxPackage_example.ps1 | cAppxPackage_example.ps1 | $cred = get-credential
$ConfigurationData = @{
AllNodes = @(
@{
NodeName='Localhost'
PSDscAllowPlainTextPassword=$true
}
)
}
configuration AppxExample
{
param (
[Parameter(Mandatory=$false)]
[PSCredential] [System.Management.Automation.Cred... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/AppVeyor/AppVeyorBuild.ps1 | AppVeyorBuild.ps1 | #---------------------------------#
# Header #
#---------------------------------#
Write-Host 'Running AppVeyor build script' -ForegroundColor Yellow
Write-Host "ModuleName : $env:ModuleName"
Write-Host "Build version : $env:APPVEYOR_BUILD_VERSION"
Write-Host "Author : $env:A... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/AppVeyor/AppVeyorInstall.ps1 | AppVeyorInstall.ps1 | #---------------------------------#
# Header #
#---------------------------------#
Write-Host 'Running AppVeyor install script' -ForegroundColor Yellow
#---------------------------------#
# Install NuGet #
#---------------------------------#
Write-Host 'Installi... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/AppVeyor/AppVeyorDeploy.ps1 | AppVeyorDeploy.ps1 | #---------------------------------#
# Header #
#---------------------------------#
Write-Host 'Running AppVeyor deploy script' -ForegroundColor Yellow
#---------------------------------#
# Update module manifest #
#---------------------------------#
Write-Host 'Creating ... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/AppVeyor/AppVeyorTest.ps1 | AppVeyorTest.ps1 | #---------------------------------#
# Header #
#---------------------------------#
Write-Host 'Running Pester Tests' -ForegroundColor Yellow
Write-Host "Current working directory: $pwd"
$ModulePath = Split-Path $pwd
Write-Host "Adding $ModulePath to 'psmodulepath' PATH variable"
$en... |
PowerShellCorpus/PowerShellGallery/cAppxPackage/0.1.1.24/Tests/cAppxPackage.Tests.ps1 | cAppxPackage.Tests.ps1 | $Modules = Get-ChildItem "$PSScriptRoot\..\" -Filter '*.psm1'
$Rules = Get-ScriptAnalyzerRule
if ($Modules.count -gt 0) {
Describe 'Testing all Modules against default PSScriptAnalyzer rule-set' {
foreach ($module in $modules) {
Context "Testing Module '$($module.FullName)'" {
foreach ($ru... |
PowerShellCorpus/PowerShellGallery/xEventLogConfiguration/1.0.0.0/DSCResources/xEventLogConfiguration/Test.ps1 | Test.ps1 |
Configuration Test
{
Import-DscResource -ModuleName xEventLogConfiguration
Node Localhost
{
xEventLogConfiguration DSCLog
{
LogName = "Microsoft-Windows-DSC/Operational"
Enable = $false
LogMode = 'AutoBackup'
MaximumSizeInBytes = 1048576000
}
}
}
|
PowerShellCorpus/PowerShellGallery/Invoke-SqlCmd2/1.6.4/Public/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/CustomizeWindows10/1.0.0.0/DSCResources/CustomizeWindows10CompositeDSCResource/Examples/CustomizeWindows10CompositeDSCResource_Example.ps1 | CustomizeWindows10CompositeDSCResource_Example.ps1 | Configuration ITPro {
Import-DscResource -ModuleName CustomizeWindows10
Node localhost {
CustomizeWindows10CompositeDSCResource WindowsSettings {
EnableWin10ConnectedStandby = $false
EnablePowerShellOnWinX = $true
EnableSnapFill = $true
EnableSnapAssist = $true
ShowFileExtensions = $true
Sh... |
PowerShellCorpus/PowerShellGallery/PSReadline/1.2/SamplePSReadlineProfile.ps1 | SamplePSReadlineProfile.ps1 |
# This is an example profile for PSReadline.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
Import-Module PSReadLine
Set-PSReadLineOption -EditMode Emacs
# Searching for commands with up/down arrow is really hand... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/ARTools.Manifest.tests.ps1 | ARTools.Manifest.tests.ps1 | Describe "ARTools Module Manifest" {
It "FunctionsToExport key contains all public functions." {
$ManifestAST = [System.Management.Automation.Language.Parser]::ParseFile("$PSScriptRoot\ARTools.psd1",[ref]$null,[ref]$null)
$ManifestHashTable = $ManifestAST.FindAll({$args[0] -is [System.Management.Automation.La... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Private/New-DynamicParameter.ps1 | New-DynamicParameter.ps1 | using namespace System.Management.Automation
function New-DynamicParameter
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'Low')]
Param (
[Parameter(Mandatory = $True)]
[string]$Name,
[Parameter(Mandatory = $False)]
[string[]]$ValidateS... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Private/Get-ConfigMgrSite.ps1 | Get-ConfigMgrSite.ps1 | #requires -Version 2
function Get-ConfigMgrSite
{
[cmdletbinding()]
Param()
Begin{}
Process{
$ManagementPointSearcher = [adsisearcher]'ObjectClass=mssmsmanagementpoint'
$ManagementPointADObject = $ManagementPointSearcher.FindOne() | Select-Object -ExpandProperty Pro... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Private/Test-PSRemoting.ps1 | Test-PSRemoting.ps1 | #requires -Version 2
function Test-PSRemoting
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0)]
[string[]]$ComputerName,
[Parameter(Mandatory = $False)]
[pscredential]$Credential = $null
)
Begin{}
Process{
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Test-Ping.ps1 | Test-Ping.ps1 | #requires -Version 2
function Test-Ping
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True,Position = 0)]
[string[]]$ComputerName
)
Begin{}
Process{
$Connectivity = @()
$Connectivity += Test-Connection -ComputerName $Compute... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Find-ErrorEventLog.ps1 | Find-ErrorEventLog.ps1 | #requires -Version 2
function Find-ErrorEventLog
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('Name')]
[string[]]$ComputerName = 'Localhost',
[Parameter(Mandatory = $False,ValueFromPipelineByPro... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-StaleDomainUser.ps1 | Get-StaleDomainUser.ps1 | #requires -Version 2
function Get-StaleDomainUser
{
<#
.Synopsis
Displays domain user accounts whose passwords have not been changed in a given number of days.
.DESCRIPTION
The Get-StaleDomainUser function displays all domain user acounts whose passwords have... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Find-UnquotedServicePath.ps1 | Find-UnquotedServicePath.ps1 | #requires -Version 2
function Find-UnquotedServicePath
{
<#
.Synopsis
Finds services that use unquoted paths.
.DESCRIPTION
The Find-UnquotedServicePath function uses Powershell remoting to query the executable paths of those services which are set to automati... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Connect-RDP.ps1 | Connect-RDP.ps1 | function Connect-RDP
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName = $null,
[Parameter(Mandatory = $False)]
[switch]$Force
)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-MailboxFolderSize.ps1 | Get-MailboxFolderSize.ps1 | #requires -Version 2
function Get-MailboxFolderSize
{
[CmdletBinding(DefaultParametersetName = 'Default')]
Param(
[Parameter(Mandatory = $True,Position = 0)]
[Alias('Username')]
[ValidateScript({
Try
{
$accou... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Confirm-ADGroupMembership.ps1 | Confirm-ADGroupMembership.ps1 | function Confirm-ADGroupMembership
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True, Position = 0)]
[string]$Identity,
[Parameter(Mandatory = $True, Position = 1)]
[string[]]$Members
)
Begin{
Try
{
$Group = Get-... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Invoke-ConfigMgrUpdate.ps1 | Invoke-ConfigMgrUpdate.ps1 | #requires -Version 2
function Invoke-ConfigMgrUpdate
{
[cmdletbinding(DefaultParameterSetName = 'SpecificAction')]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $true)]
[string[]]$ComputerName = $env:COMPUTERNAME,
[Parameter(Mandatory = $F... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Repair-Installation.ps1 | Repair-Installation.ps1 | #requires -Version 2
function Repair-Installation
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName,
[Parameter(Mandatory = $True,ParameterSetName = 'MSI',Va... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/New-VisualNotification.ps1 | New-VisualNotification.ps1 | #requires -Version 2
function New-VisualNotification
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'Low')]
Param(
[Parameter(Mandatory = $False,ValueFromPipeline)]
[string]$Message = 'Attention. Task Completed.',
[Parameter(Mandatory = $False,ValueFromPipeline)]... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-BitlockerKey.ps1 | Get-BitlockerKey.ps1 | function Get-BitlockerKey
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName','DNSHostName')]
[string[]]$ComputerName
)
Begin{
$BitlockerKeys = get-adobject -filter "objectclass -eq 'msFVE-RecoveryInf... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Connect-ConfigMgr.ps1 | Connect-ConfigMgr.ps1 | #requires -Version 2
function Connect-ConfigMgr
{
Try
{
Import-Module -Name "$env:SMS_ADMIN_UI_PATH\..\ConfigurationManager.psd1" -Global -ErrorAction Stop
$SiteCode = (Get-PSDrive -PSProvider CMSite).Name
Set-Location -Path "$SiteCode`:\"
}
Catch
{
Write-W... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-InstalledProgram.ps1 | Get-InstalledProgram.ps1 | #requires -Version 2
function Get-InstalledProgram
{
[CmdletBinding(DefaultParameterSetName = 'Default')]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('Name')]
[string[]]$ComputerName = 'Localhost',
[Parameter(Ma... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Set-Signature.ps1 | Set-Signature.ps1 | function Set-Signature
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'Medium')]
Param(
[Parameter(Mandatory = $False)]
[System.Security.Cryptography.X509Certificates.X509Certificate2]$Certificate = (Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert),
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Enable-RemotePSRemoting.ps1 | Enable-RemotePSRemoting.ps1 | #requires -Version 2
function Enable-RemotePSRemoting
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[string[]]$ComputerName,
[Parameter(Mandatory = $False)]
[switch]$Force,
[Pa... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-ADGroupMembershipTree.ps1 | Get-ADGroupMembershipTree.ps1 | #requires -Version 2
function Get-ADGroupMembershipTree
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True,Position = 0)]
[string]$Identity,
[Parameter(Mandatory = $False,Position = 1)]
[string]$Inheritence = $null
)
Begin{}
Process{
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-LoggedOnUser.ps1 | Get-LoggedOnUser.ps1 | #requires -Version 3
function Get-LoggedOnUser
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $False)]
[string[]]$ComputerName = 'Localhost',
[Parameter(Mandatory = $False)]
[string]$Username = $null,
[Parameter(Mandatory = $False)]
[swi... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-LockOutInfo.ps1 | Get-LockOutInfo.ps1 | #requires -Version 2
function Get-LockOutInfo
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('SAMAccountName')]
[string[]]$Username
)
Begin{
$DCS = Get-ADDomainController -Filter * | Sel... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Add-LocalGroupMember.ps1 | Add-LocalGroupMember.ps1 | #requires -Version 2
function Add-LocalGroupMember
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName = 'localhost',
[Parameter(Mandatory =... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Reset-ADPassword.ps1 | Reset-ADPassword.ps1 | #requires -Version 2
function Reset-ADPassword
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True)]
[ValidateScript({
Try
{
$account = $_
$... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Remove-UserProfile.ps1 | Remove-UserProfile.ps1 | #requires -Version 2
function Remove-UserProfile
{
[CmdletBinding(DefaultParameterSetName = 'Specific')]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True,ParameterSetName = 'Specific')]
[ValidateScript({
If($_ -ne $env:USERNAME)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-DomainPC.ps1 | Get-DomainPC.ps1 | function Get-DomainPC
{
[cmdletbinding(DefaultParameterSetName = 'Default')]
Param(
[Parameter(Mandatory = $True,ParameterSetName = 'ByName')]
[string]$Name,
[Parameter(Mandatory = $True,ParameterSetName = 'ByDescription')]
[string]$Description,
[Parameter(Mandatory = $True)]
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-DellWarranty.ps1 | Get-DellWarranty.ps1 | function Get-DellWarranty
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[string[]]$ComputerName
)
Begin{
$DellWebProxy = New-WebServiceProxy -Uri 'http://xserv.dell.com/services/AssetService.asmx?WSDL'
$Del... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-StaleLocalUser.ps1 | Get-StaleLocalUser.ps1 | #requires -Version 2
function Get-StaleLocalUser
{
<#
.Synopsis
Displays local user accounts whose passwords have not been changed in a given number of days.
.DESCRIPTION
The Get-StaleLocalUser function uses Powershell remoting to display local user accou... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Disconnect-LoggedOnUser.ps1 | Disconnect-LoggedOnUser.ps1 | #requires -Version 2
function Disconnect-LoggedOnUser
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[string]$ComputerName,
[Parameter(Mandatory = $True,Position = 1,ValueFromPipelineByPropertyName = $... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-LocalGroupMembership.ps1 | Get-LocalGroupMembership.ps1 | #requires -Version 2
function Get-LocalGroupMembership
{
<#
.Synopsis
Gets local group membership details.
.DESCRIPTION
The Get-LocalGroupMembership function uses Powershell remoting to find all members of local/builtin groups on remote computers. By default,... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Import-Credential.ps1 | Import-Credential.ps1 | #requires -Version 2
function Import-Credential
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[string]$Username = $env:USERNAME,
[Parameter(Mandatory = $False)]
[string]$Domain = $env:USERDNSDOMAIN,
[Parameter(Mandatory = $False... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/New-User.ps1 | New-User.ps1 | #requires -Version 3
function New-User
{
[cmdletbinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True,ParameterSetName = 'SpecificUser')]
[string]$ReferenceUsername,
[Parameter(Mandatory = $True,ParameterSetName = 'Browse')]
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Update-ConfigMgrApplicationDeploymentTypeScript.ps1 | Update-ConfigMgrApplicationDeploymentTypeScript.ps1 | Function Update-ConfigMgrApplicationDeploymentTypeScript
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True)]
[System.IO.FileInfo]$ScriptPath
)
DynamicParam{
$CMSite = Get-ConfigMgrSite
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-IPAddressRange.ps1 | Get-IPAddressRange.ps1 | function Get-IPAddressRange
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[string]$StartIPAddress,
[Parameter(Mandatory = $true)]
[string]$EndIPAddress
)
Begin{}
Process{
$StartIPAddressArray = $StartIPA... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Find-AlternateEmailAddress.ps1 | Find-AlternateEmailAddress.ps1 | function Find-AlternateEmailAddress
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[string]$Identity = '*'
)
Begin{
Try
{
Write-Verbose -Message 'Checking for Exchange session ...'
$null = Get-PSSession -Name Exchange -Er... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Disable-User.ps1 | Disable-User.ps1 | function Disable-User
{
[CmdletBinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True)]
[ValidateScript({
$Identity = $PSItem
Try
{
$null = Get-ADUser -Ident... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Add-WorkstationPrinter.ps1 | Add-WorkstationPrinter.ps1 | #requires -Version 2
function Add-WorkstationPrinter
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[Alias('Server')]
[string]$PrintServer,
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-ServiceExecutablePermission.ps1 | Get-ServiceExecutablePermission.ps1 | #requires -Version 2
function Get-ServiceExecutablePermission
{
<#
.Synopsis
Gets file permissions of service executables.
.DESCRIPTION
The Get-ServiceExecutablePermissions function uses Powershell remoting to query the file permissions of service executables f... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-ADPrincipalGroupMembershipTree.ps1 | Get-ADPrincipalGroupMembershipTree.ps1 | #requires -Version 2
function Get-ADPrincipalGroupMembershipTree
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True,Position = 0)]
[string]$Identity,
[Parameter(Mandatory = $False,Position = 1)]
[string]$Inheritence = $null
)
Begin{}
Pr... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-Phonetic.ps1 | Get-Phonetic.ps1 | #requires -Version 2
function Get-Phonetic
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $true,ValueFromPipeLine = $true)]
[Char[]]$Char
)
Begin{
[HashTable]$PhoneticTable = @{
'a' = 'Alpha'
'b' = 'Bravo'
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Reset-WindowsUpdate.ps1 | Reset-WindowsUpdate.ps1 | #requires -Version 2
function Reset-WindowsUpdate
{
[cmdletbinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True)]
[string[]]$ComputerName,
[Parameter(Mandatory = $False)]
[pscredential]$Credential = $null
)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Invoke-ConfigMgrInstallation.ps1 | Invoke-ConfigMgrInstallation.ps1 | #requires -Version 2
function Invoke-ConfigMgrInstallation
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[string[]]$ComputerName,
[Parameter(Mandatory = $True,Position = 1)]
[ValidateSet('Install','Unins... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Remove-LocalGroupMember.ps1 | Remove-LocalGroupMember.ps1 | #requires -Version 2
function Remove-LocalGroupMember
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName = 'localhost',
[Parameter(Mandator... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/ConvertTo-EncodedCommand.ps1 | ConvertTo-EncodedCommand.ps1 | function ConvertTo-EncodedCommand
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position=0)]
[string]$Command
)
Begin{}
Process{
$ByteForm = [System.Text.Encoding]::Unicode.GetBytes($Command)
[Convert]::ToBase64String($ByteForm)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/New-EchosignUser.ps1 | New-EchosignUser.ps1 | #requires -Version 3
function New-EchosignUser
{
[cmdletbinding(SupportsShouldProcess = $True,ConfirmImpact = 'High')]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[Alias('FirstName')]
[string]$GivenName,
[Parameter(Mandatory = $True,V... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Convert-ArrayToString.ps1 | Convert-ArrayToString.ps1 | function Convert-ArrayToString
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=0)]
[AllowEmptyCollection()]
[Array]$Array,
[Parameter(Mandatory=$False)]
[switch]$Flatten
)
Begin{
If($Flatten)
{... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Convert-HashToString.ps1 | Convert-HashToString.ps1 | function Convert-HashToString
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=0)]
[Hashtable]$Hashtable,
[Parameter(Mandatory=$False)]
[switch]$Flatten
)
Begin{
If($Flatten -or $Hashtable.Keys.Count -eq 0)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Test-TCPPort.ps1 | Test-TCPPort.ps1 | function Test-TCPPort
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True,Position = 0,ParameterSetName = 'Undefined')]
[string]$StartIPAddress,
[Parameter(Mandatory = $False,Position = 1,ParameterSetName = 'Undefined')]
[string]$EndIPAddress = $null,
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Search-ADAccountByName.ps1 | Search-ADAccountByName.ps1 | function Search-ADAccountByName
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[Alias('Givenname','First Name')]
[string]$FirstName,
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[Alia... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/New-RandomPassword.ps1 | New-RandomPassword.ps1 | #requires -Version 2
Function New-RandomPassword
{
[cmdletbinding(SupportsShouldProcess = $True,ConfirmImpact = 'Low')]
Param (
[Parameter(Mandatory = $False)]
[ValidateRange(1,128)]
[Int]$PasswordLength = 9,
[Parameter(Mandatory = $False)]
[switch]... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Invoke-Installation.ps1 | Invoke-Installation.ps1 | <#
.EXAMPLE
Invoke-Installation -ComputerName VM-ADRIANR -ProductName CDM -WorkingDirectory '\\corp-sdp1\install$\Fiserv\CDM-8dot1' -FilePath CDMInstall.ps1 -PowerShellScript -Credential $MyCredential -Verbose
#>
function Invoke-Installation
{
[cmdletbinding(DefaultParameterSetName = 'MSI')]
Param(
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Remove-Installation.ps1 | Remove-Installation.ps1 | #requires -Version 2
function Remove-Installation
{
[cmdletbinding(DefaultParameterSetName = 'MSI')]
Param(
[Parameter(Mandatory = $True,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName,
[Parameter(Mandatory = $T... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Remove-Signature.ps1 | Remove-Signature.ps1 | #requires -Version 2
function Remove-Signature
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipeline = $True,ValueFromPipelineByPropertyName = $True)]
[Alias('Path')]
[system.io.fileinfo[]]$FilePath
)
Begin{
Push-Location -P... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Connect-Viewer.ps1 | Connect-Viewer.ps1 | #requires -Version 2
function Connect-Viewer
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False,Position = 0,ValueFromPipelineByPropertyName = $True)]
[Alias('PSComputerName')]
[string[]]$ComputerName,
[Parameter(Mandatory = $False)]
[switch]$Hidden... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/ConvertFrom-EncodedCommand.ps1 | ConvertFrom-EncodedCommand.ps1 | function ConvertFrom-EncodedCommand
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,Position=0)]
[string]$EncodedCommand
)
Begin{}
Process{
[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($EncodedCommand));
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Remove-WorkstationPrinter.ps1 | Remove-WorkstationPrinter.ps1 | #requires -Version 2
function Remove-WorkstationPrinter
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[string]$PrintServer,
[Parameter(Mandatory = $True,ValueFromPipelineByPropertyName = $True)]
[string[]]$PrinterNam... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Connect-Exchange.ps1 | Connect-Exchange.ps1 | #requires -Version 2
function Connect-Exchange
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[pscredential]$Credential = $null,
[Parameter(Mandatory = $True)]
[string]$Server,
[Parameter(Mandatory = $False)]
[System... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Save-Credential.ps1 | Save-Credential.ps1 | #requires -Version 2
function Save-Credential
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[string]$Username = $env:USERNAME,
[Parameter(Mandatory = $False)]
[SecureString]$SecurePassword,
[Parameter(Mandatory = $False)]
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Get-WorkstationPrinter.ps1 | Get-WorkstationPrinter.ps1 | #requires -Version 2
function Get-WorkstationPrinter
{
[cmdletbinding()]
Param(
[Parameter(Mandatory = $False)]
[Alias('PSComputerName')]
[string[]]$ComputerName = 'localhost',
[Parameter(Mandatory = $False)]
[pscredential]$Credential = $null
)
... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Send-NetMessage.ps1 | Send-NetMessage.ps1 | #requires -Version 2
function Send-NetMessage
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $True)]
[string[]]$ComputerName,
[Parameter(Mandatory = $True)]
[string]$Message,
[Parameter(Mandatory = $False)]
[string[]]$Username = $nul... |
PowerShellCorpus/PowerShellGallery/ARTools/2016.5.7.3/Public/Connect-Lync.ps1 | Connect-Lync.ps1 | #requires -Version 2
function Connect-Lync
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[pscredential]$Credential = $null,
[Parameter(Mandatory = $True)]
[string]$Server,
[Parameter(Mandatory = $False)]
[System.Sec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.