full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/ExtraLarge/0.2.0/Get-XLSheet.ps1
Get-XLSheet.ps1
Function Get-XLSheet { [CmdletBinding()] [OutputType([XLSheet])] param( [Parameter(ParameterSetName = "FileAndName", Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [Parameter(ParameterSetName = "FileAndIndex", Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [Parameter(Parame...
PowerShellCorpus/PowerShellGallery/ExtraLarge/0.2.0/Add-XLTable.ps1
Add-XLTable.ps1
# internal helper functions function Get-Value($Datum, $ColumnDefinition) { $value = $Datum | ForEach-Object -Process $ColumnDefinition.Expression; if ($value -eq $null -and $ColumnDefinition.ContainsKey('Default')) { $value = $ColumnDefinition.Default; } $value; } function Get-Columns($Da...
PowerShellCorpus/PowerShellGallery/ExtraLarge/0.2.0/Get-XLFile.ps1
Get-XLFile.ps1
Function Get-XLFile { [CmdletBinding()] [OutputType([XLFile])] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string]$Path ) begin{} process{ $resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path); if (-not (Test-Path -LiteralPath $res...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexRadio.ps1
FlexRadio.ps1
# FlexRadio.ps1 # note: serial number (property name "serial") should be the primary identifier for each radio # there is a global variable $global:flexradios that will contain all flex radios found # the various module cmdlets should be able to get/set on that object by finding a matching serial number. functi...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexPanadapter.ps1
FlexPanadapter.ps1
# FlexPanadapter.ps1 function get-FlexPanadapter { [CmdletBinding(DefaultParameterSetName="p0")] param( [Parameter(ParameterSetName="p0",Position=0, ValueFromPipelineByPropertyName = $true)] [string]$Serial, [Parameter(ParameterSetName="p0",Position=1, ValueFromPipelineByP...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexBackup.ps1
FlexBackup.ps1
# FlexBackup.ps1 function export-FlexDatabase { [CmdletBinding(DefaultParameterSetName="p1", SupportsShouldProcess=$true, ConfirmImpact="Low")] param( [Parameter(ParameterSetName="p0",Position=0, ValueFromPipelineByPropertyName = $true)] [Parameter(ParameterSetName=...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/get-packet.ps1
get-packet.ps1
# # get-packet.ps1 # # Receives and displays all incoming IP packets. NIC driver must support promiscuous mode. # # Usage: get-packet.ps1 [-LocalIP [<String>]] [-Protocol [<String>]] [[-Seconds] [<Int32>]] [-ResolveHosts] [-Statistics] [-Silent] # # Author: Robbie Foust (rfoust@duke.edu) # Date: Nov 19, 2007 ...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexUtil.ps1
FlexUtil.ps1
# FlexUtil.ps1 function get-FlexControlLog { $AppData = $env:AppData $FCLog = join-path $AppData "FlexRadio Systems\LogFiles\SSDR_FCManager.log" foreach ($line in (get-content $FCLog)) { if ($line) { $line = $line -replace "M: ","M|" ...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexSlice.ps1
FlexSlice.ps1
# FlexSlice.ps1 function get-FlexSliceReceiver { [CmdletBinding(DefaultParameterSetName="p0")] param( [Parameter(ParameterSetName="p0",Position=0, ValueFromPipelineByPropertyName = $true)] [Parameter(ParameterSetName="p1",Position=0, ValueFromPipelineByPropertyName = $true)] ...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexLib.ps1
FlexLib.ps1
# FlexLib.ps1 # Is this a Wow64 powershell host function Test-Wow64() { return (Test-Win32) -and (test-path env:\PROCESSOR_ARCHITEW6432) } # Is this a 64 bit process function Test-Win64() { return [IntPtr]::size -eq 8 } # Is this a 32 bit process function Test-Win32() { return [IntPtr]::siz...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexMemory.ps1
FlexMemory.ps1
# FlexMemory.ps1 function get-FlexMemory { [CmdletBinding(DefaultParameterSetName="p0", SupportsShouldProcess=$true, ConfirmImpact="Low")] param( [Parameter(ParameterSetName="p0",Position=0, ValueFromPipelineByPropertyName = $true)] [string]$Serial, [Para...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexPacket.ps1
FlexPacket.ps1
# FlexPacket.ps1 function displayTime { $now = get-date -format "HH:mm:ss" write-host "[" -foregroundcolor green -nonewline write-host $now -foregroundcolor gray -nonewline write-host "]" -foregroundcolor green -nonewline # write-host " : " -foregroundcolor white -nonewline } ...
PowerShellCorpus/PowerShellGallery/FlexModule/1.0.0.0/FlexProfile.ps1
FlexProfile.ps1
# FlexProfile.ps1 function get-FlexProfile { [CmdletBinding(DefaultParameterSetName="p0", SupportsShouldProcess=$true, ConfirmImpact="Low")] param( [Parameter(ParameterSetName="p0",Position=0, ValueFromPipelineByPropertyName = $true)] [string]$Serial ) ...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/Examples/Sample - CreateMultipleShares.ps1
Sample - CreateMultipleShares.ps1
Configuration CreateMultipleShares { Import-DscResource -ModuleName cFileShare node [target server name] { cCreateFileShare CreateShare { ShareName = '[share name]' Path = '[folder path]' Ensure = 'Present' } cCreateF...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/Examples/Sample - CreateDropShare.ps1
Sample - CreateDropShare.ps1
Configuration CreateDropShare { Import-DscResource -ModuleName cFileShare node [target server name] { cCreateFileShare CreateShare { ShareName = '[share name]' Path = '[folder path]' Ensure = 'Present' } cSetSharePerm...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/Examples/Sample - AlterPermissions.ps1
Sample - AlterPermissions.ps1
Configuration AlterPermissions { Import-DscResource -ModuleName cFileShare node [target server name] { cSetSharePermissions SetPermissions { ShareName = '[Share name]' Ensure = 'Absent' FullAccessUsers = @('[user 1]') ...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/ResourceDesignerScripts/Generate_VSAR_cFileShare_Schema.ps1
Generate_VSAR_cFileShare_Schema.ps1
#This creates the definition for the resource #The share to create $ShareName = New-xDscResourceProperty -Name ShareName -Type String -Attribute Key #The path where the folder that maps to the share should be created $Path = New-xDscResourceProperty -Name Path -Type String -Attribute Required #Identify ...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/Unit Tests/VSAR_cSetSharePermissions_UnitTests.ps1
VSAR_cSetSharePermissions_UnitTests.ps1
#Unit tests for VSAR_cSetSharePermissions Import-Module "C:\Program Files\WindowsPowerShell\Modules\cFileShare\DSCResources\VSAR_cSetSharePermissions" #Variable Declarations $ShareName = "TestShare" $Users = @("[domain]\[user1]", "[domain]\[user2]") $Path = "C:\Test" $User1 = "[domain]\[user1]" $User2 = "[doma...
PowerShellCorpus/PowerShellGallery/cFileShare/1.0.0.1/Unit Tests/VSAR_cCreateFileShare_UnitTests.ps1
VSAR_cCreateFileShare_UnitTests.ps1
#Unit tests for VSAR_cCreateFileShare Import-Module "C:\Program Files\WindowsPowerShell\Modules\cFileShare\DSCResources\VSAR_cCreateFileShare" #Variable Declarations $ShareName = "TestShare" $Path = "C:\Test" $PassCounter = 0 $FailCounter = 0 ############################## # # Tests for Get-TargetResourc...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-MultiInstance.ps1
SCDPM-MultiInstance.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-SingleServer-TP.ps1
SCDPM-SingleServer-TP.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-SingleServer.ps1
SCDPM-SingleServer.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-SeperateSQL-TP.ps1
SCDPM-SeperateSQL-TP.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-MultiInstance-TP.ps1
SCDPM-MultiInstance-TP.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/xSCDPM/1.2.0.0/Examples/SCDPM-SeperateSQL.ps1
SCDPM-SeperateSQL.ps1
#requires -Version 5 Configuration DPM { Import-DscResource -Module xDismFeature Import-DscResource -Module xSqlServer Import-DscResource -Module xSCDPM # Set role and instance variables $Roles = $AllNodes.Roles | Sort-Object -Unique foreach($Role in $Roles) { $Servers ...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Invoke-Sum.ps1
Invoke-Sum.ps1
function Invoke-Sum { param( $data, $dimension, $measure ) if(!$measure) {$measure = $dimension} $h=@{} foreach ($item in $data){ $key=$item.$dimension if(!$key) {$key="[missing]"} if(!$h.ContainsKey($key)) { $h.$key=[...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Pivot.ps1
Pivot.ps1
function Pivot { [CmdletBinding()] param( $targetData, $pivotRows, $pivotData, [OfficeOpenXml.Drawing.Chart.eChartType]$ChartType="Pie" ) if(!$pivotData) {$pivotData=$pivotRows} $xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx" Writ...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Set-CellStyle.ps1
Set-CellStyle.ps1
function Set-CellStyle { param( $WorkSheet, $Row, $LastColumn, [OfficeOpenXml.Style.ExcelFillStyle]$Pattern, [System.Drawing.Color]$Color ) $t=$WorkSheet.Cells["A$($Row):$($LastColumn)$($Row)"] $t.Style.Fill.PatternType=$Pattern $t.Style.Fill.Backg...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/InferData.ps1
InferData.ps1
function Test-String{ param($p) [PSCustomObject]@{ Test=$p -is [string] DataType = "string" } } function Test-Date { param($p) [datetime]$result = [datetime]::MinValue [PSCustomObject]@{ Test=[datetime]::TryParse($p, [ref]$result) DataType = "...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/TrackingUtils.ps1
TrackingUtils.ps1
function Import-USPS { param( $TrackingNumber, [Switch]$UseDefaultCredentials ) Import-Html "https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=$($TrackingNumber)" 0 -UseDefaultCredentials: $UseDefaultCredentials } function Import-UPS { param( $TrackingNumbe...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-ExcelColumnName.ps1
Get-ExcelColumnName.ps1
function Get-ExcelColumnName { param( [Parameter(ValueFromPipeline=$true)] $columnNumber=1 ) Process { $dividend = $columnNumber $columnName = @() while($dividend -gt 0) { $modulo = ($dividend - 1) % 26 $columnName += [char](65...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-Range.ps1
Get-Range.ps1
function Get-Range ($start=0,$stop,$step=1) { for ($idx = $start; $idx -lt $stop; $idx+=$step) {$idx} }
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Charting.ps1
Charting.ps1
function DoChart { param( $targetData, $title, [OfficeOpenXml.Drawing.Chart.eChartType]$ChartType, [Switch]$NoLegend, [Switch]$ShowCategory, [Switch]$ShowPercent ) if($targetData[0] -is [System.ValueType]) { $chart = New-ExcelChart -YRan...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-ExcelWorkbookInfo.ps1
Get-ExcelWorkbookInfo.ps1
Function Get-ExcelWorkbookInfo { <# .SYNOPSIS Retrieve information of an Excel workbook. .DESCRIPTION The Get-ExcelWorkbookInfo cmdlet retrieves information (LastModifiedBy, LastPrinted, Created, Modified, ...) fron an Excel workbook. These are the same details that are visible in...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/New-ConditionalFormattingIconSet.ps1
New-ConditionalFormattingIconSet.ps1
function New-ConditionalFormattingIconSet { param( [Parameter(Mandatory=$true)] $Range, [ValidateSet("ThreeIconSet","FourIconSet","FiveIconSet")] $ConditionalFormat, [Switch]$Reverse ) DynamicParam { $IconType = New-Object System.Management.Automati...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/plot.ps1
plot.ps1
class PSPlot { hidden $path hidden $pkg hidden $ws hidden $chart PSPlot() { $this.path=[System.IO.Path]::GetTempFileName() -replace "\.tmp", ".xlsx" $this.pkg = New-Object OfficeOpenXml.ExcelPackage $this.path $this.ws=$this.pkg.Workbook.Worksheets.Add("plot") ...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Import-Html.ps1
Import-Html.ps1
function Import-Html { [CmdletBinding()] param( $url, $index, $Header, [int]$FirstDataRow=0, [Switch]$UseDefaultCredentials ) $xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx" rm $xlFile -ErrorAction Ignore Wr...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-HtmlTable.ps1
Get-HtmlTable.ps1
function Get-HtmlTable { param( [Parameter(Mandatory=$true)] $url, $tableIndex=0, $Header, [int]$FirstDataRow=0, [Switch]$UseDefaultCredentials ) $r = Invoke-WebRequest $url -UseDefaultCredentials: $UseDefaultCredentials $table = $r.Parse...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-ExcelSheetInfo.ps1
Get-ExcelSheetInfo.ps1
Function Get-ExcelSheetInfo { <# .SYNOPSIS Get worksheet names and their indices of an Excel workbook. .DESCRIPTION The Get-ExcelSheetInfo cmdlet gets worksheet names and their indices of an Excel workbook. .PARAMETER Path Specifies the path to the Excel file. This par...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/New-ExcelChart.ps1
New-ExcelChart.ps1
function New-ExcelChart { param( $Title="Chart Title", $Header, [OfficeOpenXml.Drawing.Chart.eChartType]$ChartType="ColumnStacked", $XRange, $YRange, $Width=500, $Height=350, $Row=0, $RowOffSetPixels=10, $Column=6, $...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Copy-ExcelWorkSheet.ps1
Copy-ExcelWorkSheet.ps1
function Copy-ExcelWorkSheet { [CmdletBinding()] param( [Parameter(Mandatory=$true)] $SourceWorkbook, [Parameter(Mandatory=$true)] $SourceWorkSheet, [Parameter(Mandatory=$true)] $DestinationWorkbook, $DestinationWorkSheet, [Switch]$Show ...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/New-ConditionalText.ps1
New-ConditionalText.ps1
function New-ConditionalText { param( #[Parameter(Mandatory=$true)] $Text, [System.Drawing.Color]$ConditionalTextColor="DarkRed", [System.Drawing.Color]$BackgroundColor="LightPink", [String]$Range, [OfficeOpenXml.Style.ExcelFillStyle]$PatternType=[OfficeOpenXml...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Get-XYRange.ps1
Get-XYRange.ps1
function Get-XYRange { param($targetData) $record = $targetData| select -First 1 $p=$record.psobject.Properties.name $infer = for ($idx = 0; $idx -lt $p.Count; $idx++) { $name = $p[$idx] $value = $record.$name $result=Invoke-AllTests $value -OnlyPassing -FirstOne ...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/New-PSItem.ps1
New-PSItem.ps1
function New-PSItem { $totalArgs = $args.Count if($args[-1] -is [array]) { $script:PSItemHeader=$args[-1] $totalArgs-=1 } $h=[ordered]@{} for ($idx = 0; $idx -lt $totalArgs; $idx+=1) { if($PSItemHeader) { $key = $PSItemHeader[$idx] } else...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Export-Excel.ps1
Export-Excel.ps1
Function Export-Excel { <# .SYNOPSIS Export data to an Excel work sheet. .EXAMPLE Get-Service | Export-Excel .\test.xlsx .EXAMPLE Get-Process | Export-Excel .\test.xlsx -show\ .EXAMPLE Get-Process | Export-Excel .\test.xl...
PowerShellCorpus/PowerShellGallery/ImportExcel/2.4.0/Export-ExcelSheet.ps1
Export-ExcelSheet.ps1
function Export-ExcelSheet { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [String]$Path, [String]$OutputPath = '.\', [String]$SheetName, [ValidateSet('ASCII', 'BigEndianUniCode','Default','OEM','UniCode','UTF32','UTF7','UTF8')] [string]$...
PowerShellCorpus/PowerShellGallery/DSCR_PowerPlan/1.0.0/Sample/PowerPlan.ps1
PowerPlan.ps1
$output = 'C:\MOF' Configuration PowerPlan_Sample { Import-DscResource -ModuleName DSCR_PowerPlan Node localhost { cPowerPlan PowerPlan_Sample { Ensure = "Present" GUID = "381b4222-f694-41f0-9685-ff5bb260df2e" Name = "Balanced" Act...
PowerShellCorpus/PowerShellGallery/cSABnzbd/1.5/Examples/cSABnzbdInstall.ps1
cSABnzbdInstall.ps1
configuration DownloadHostDSC { Import-DscResource -ModuleName 'cSABnzbd' cSABnzbdInstall SABnzbdInstaller { Ensure = 'Present' } }
PowerShellCorpus/PowerShellGallery/TaskModuleIISManageUtility/0.1.7/AppCmdOnTargetMachines.ps1
AppCmdOnTargetMachines.ps1
Write-Verbose "Entering script AppCmdOnTargetMachines.ps1" $AppCmdRegKey = "HKLM:\SOFTWARE\Microsoft\InetStp" function Get-AppCmdLocation { param( [string][Parameter(Mandatory=$true)]$regKeyPath ) $appCmdNotFoundError = "Cannot find appcmd.exe location. Verify IIS is configured on $en...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Get-GitHubSessionInformation.ps1
Get-GitHubSessionInformation.ps1
function Get-GitHubSessionInformation { <# .SYNOPSIS Private function to retrieve a sessionstate variable and check for it's existence .DESCRIPTION Private function to retrieve a sessionstate variable and check for it's existence .INPUTS None. .OUTPUTS System.Management.Au...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/New-GitHubRelease.ps1
New-GitHubRelease.ps1
function New-GitHubRelease { <# .SYNOPSIS Create a new release for a repository .DESCRIPTION Create a new release for a repository .PARAMETER Repository The name of the repository .PARAMETER Name The name of the release .PARAMETER Description Text describing th...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Remove-GitHubRelease.ps1
Remove-GitHubRelease.ps1
function Remove-GitHubRelease { <# .SYNOPSIS Remove a release .DESCRIPTION Remove a release .PARAMETER Repository The name of the repository .PARAMETER Id The Id of the release to remove .INPUTS System.String .OUTPUTS System.Management.Automation.PS...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Invoke-GitHubRestMethod.ps1
Invoke-GitHubRestMethod.ps1
function Invoke-GitHubRestMethod { <# .SYNOPSIS A module specific wrapper for Invoke-ResetMethod .DESCRIPTION A module specific wrapper for Invoke-ResetMethod .PARAMETER Method METHOD: GET, POST, PUT, DELETE .PARAMETER URI Service URI .PARAMETER Body Payload fo...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Get-GitHubReleaseAsset.ps1
Get-GitHubReleaseAsset.ps1
function Get-GitHubReleaseAsset { <# .SYNOPSIS Get a list of assets for a release .DESCRIPTION Get a list of assets for a release .PARAMETER Repository The name of the repository .PARAMETER Id The id of the release .PARAMETER Page The page number to return .PARAMETER Per...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Export-GitHubReleaseAsset.ps1
Export-GitHubReleaseAsset.ps1
function Export-GitHubReleaseAsset { <# .SYNOPSIS Get a list of assets for a release .DESCRIPTION Get a list of assets for a release .PARAMETER Repository The name of the repository .PARAMETER Id The id of the asset to export .PARAMETER Path The resulting path. If this parame...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Set-GitHubSessionInformation.ps1
Set-GitHubSessionInformation.ps1
function Set-GitHubSessionInformation { <# .SYNOPSIS Create information for this session .DESCRIPTION Create information for this session .PARAMETER Username The username that has priveleges to manage the repository .PARAMETER APIKey The personal access token associated wi...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Get-GitHubRelease.ps1
Get-GitHubRelease.ps1
function Get-GitHubRelease { <# .SYNOPSIS Get a list of releases for a Repository .DESCRIPTION Get a list of releases for a Repository .PARAMETER Repository The name of the repository .PARAMETER Id The id of the release .PARAMETER Tag The tag associated with th...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Import-GitHubReleaseAsset.ps1
Import-GitHubReleaseAsset.ps1
function Import-GitHubReleaseAsset { <# .SYNOPSIS Upload a an asset to a release .DESCRIPTION Upload a an asset to a release .PARAMETER Repository The name of the repository .PARAMETER ReleaseId The id of the release .PARAMETER Name The name of the asset ...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Set-GitHubRelease.ps1
Set-GitHubRelease.ps1
function Set-GitHubRelease { <# .SYNOPSIS Set information about a release .DESCRIPTION Set information about a release .PARAMETER Repository The name of the repository .PARAMETER Id The id of the release .PARAMETER Tag The name of the TagName .PARAMETER Target Specif...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Remove-GitHubReleaseAsset.ps1
Remove-GitHubReleaseAsset.ps1
function Remove-GitHubReleaseAsset { <# .SYNOPSIS Remove an asset from a release .DESCRIPTION Remove an asset from a release .PARAMETER Repository The name of the repository .PARAMETER Id The id of the asset .INPUTS System.String .OUTPUTS System.Management.Automation...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Set-GitHubReleaseAsset.ps1
Set-GitHubReleaseAsset.ps1
function Set-GitHubReleaseAsset { <# .SYNOPSIS Set information about an asset .DESCRIPTION Set information about an asset .PARAMETER Repository The name of the repository .PARAMETER Id The id of the asset .PARAMETER Name The name of the asset .PARAMETER Label An alte...
PowerShellCorpus/PowerShellGallery/GitHubReleaseManager/1.1.1/Functions/Public/Remove-GitHubSessionInformation.ps1
Remove-GitHubSessionInformation.ps1
function Remove-GitHubSessionInformation { <# .SYNOPSIS Remove session variables from the current session .DESCRIPTION Remove session variables from the current session .INPUTS None .OUTPUTS None .EXAMPLE Remove-GitHubSessionInformation #> [CmdletBinding(SupportsShouldProces...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Private/Get-SevenZipExecutable.ps1
Get-SevenZipExecutable.ps1
############################################################################################################## # Get-SevenZipExecutable # Gets the path to the 7-zip executable if present, otherwise returns null ###########################################################################################################...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Private/Use-NetworkShare.ps1
Use-NetworkShare.ps1
############################################################################################################## # Use-NetworkShare # Mounts or Unmounts a file share via "net use" using the specified credentials ###########################################################################################################...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Invoke-ProcessHelper.ps1
Invoke-ProcessHelper.ps1
<# .Synopsis Utility function for executing processes with advance output/error handling options .Description Utility function for executing processes with advance output/error handling options. This function leverages the System.Diagnostics.ProcessStartInfo and System.Diagnostics.Process for invoking an e...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Remove-ItemBackground.ps1
Remove-ItemBackground.ps1
<# .Synopsis Removes an item using a background job .Description Removes an item using a background job. This help in the cases where an antivirus might have a lock on an item. .Parameter Path The path to the item that will be deleted in the background .Example # Removes all the items in a temp direc...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Get-JavaProperties.ps1
Get-JavaProperties.ps1
<# .Synopsis Reads a Java-style Properties file and returns a hashtable of its content .Description Retrieves properties from a java property file and returns them as a hashtable. It allows specific properties to be retrived, in the case the property file is too large .Parameter PropertyFilePath The path t...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Set-JavaProperties.ps1
Set-JavaProperties.ps1
<# .Synopsis Updates a java property file based on the provided hashtable .Description Updates a java property file based on the provided hashtable. It allows to either append new Properties or only modify existing ones. .Parameter PropertyFilePath The path to the property file that will be modified. .Pa...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Invoke-Batch.ps1
Invoke-Batch.ps1
<# .Synopsis Utility function for executing batch jobs using Invoke-Command .Description Utility function for executing batch jobs using Invoke-Command .Parameter BatchFile The path to the batch file that will be executed. .Parameter Arguments The arguments that will be passed to the process if applicab...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Expand-ZipFile.ps1
Expand-ZipFile.ps1
<# .Synopsis Extracts the content of a zip file to a target folder. .Description Extracts the content of a zip file to a target folder. For performance reasons, it leverages 7-zip if its found in the path. Otherwise, it'll use the Expand-Archive, the PowerShell built-in CmdLet. If DestinationPath is not ...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Get-UserBaseName.ps1
Get-UserBaseName.ps1
<# .Synopsis Returns the base part of the username given a full username .Description Returns the base part of the username given a full username. If its a distringuished name the first part of the user object is used .Parameter UserName The full username that will be parsed .Example # Returns myuseri...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Get-CredentialBaseName.ps1
Get-CredentialBaseName.ps1
<# .Synopsis Returns the base part of a username in a credential object. See Get-UserBaseName .Description Returns the username of a credential object. If the credential object is a distringuished name the first part of the user object is used .Parameter UserCredential The credential object #> Function G...
PowerShellCorpus/PowerShellGallery/blueshellutils/0.0.7/Public/Copy-RemoteItemLocally.ps1
Copy-RemoteItemLocally.ps1
<# .Synopsis Copies a remote file/folder to a local destination .Description Utility function for copying remote files locally. It leverages windows net use to map a share folder and supports network credentials for mounting the share. .Parameter Source The path to the file/folder to copy. It could be a n...
PowerShellCorpus/PowerShellGallery/Invoke-OdinApi/1.2.1/Format-Xml.ps1
Format-Xml.ps1
function Format-Xml { #.Synopsis # Pretty-print formatted XML source #.Description # Runs an XmlDocument through an auto-indenting XmlWriter #.Example # [xml]$xml = get-content Data.xml # C:\PS>Format-Xml $xml #.Example # get-content Data.xml | Format-Xml #.E...
PowerShellCorpus/PowerShellGallery/Invoke-OdinApi/1.2.1/Invoke-OdinApi.ps1
Invoke-OdinApi.ps1
<# class Base64 { [string]$ItemName Base64([string]$String) { $this.ItemName = $String } [string]ToString() { return $this.ItemName } } #> if (!([System.Management.Automation.PSTypeName]'Base64').Type) { Add-Type -Language CSharp -TypeDefinition @" p...
PowerShellCorpus/PowerShellGallery/Invoke-OdinApi/1.2.1/Examples/Invoke-OdinApi Example.ps1
Invoke-OdinApi Example.ps1
[int]$Subscription = 1001880 #region ############ BA Example Methods ############ #<# Example PlaceSubscriptionCancellationOrder_API $Method = 'PlaceSubscriptionCancellationOrder_API' $Parameters = [ordered]@{ 'SubscriptionID' = $Subscription 'CancelType' = [int]30 'ReasonID' = [int]14 'Descr'...
PowerShellCorpus/PowerShellGallery/HipChat/1.0/Functions/Send-HCRoomMessage.ps1
Send-HCRoomMessage.ps1
function Send-HCRoomMessage { <# .SYNOPSIS Sends a message to a HipChat room using version 2 api .DESCRIPTION See synopsis. .EXAMPLE Send-HCRoomMessage -Message 'Hello world!' -RoomID 9999 -AuthToken 000000008c036ce74151407cad43256a6386b99b -Hostname api.hipchat.com .EXAMPLE Send-HCRoomMessage -Messag...
PowerShellCorpus/PowerShellGallery/Get-FileVersion/1.5/test.ps1
test.ps1
Function Get-FileVersion { <# .SYNOPSIS Get-FileVersion will return the File Version from an .EXE or .DLL file. .DESCRIPTION Get-FileVersion will return the File Version from an .EXE or .DLL file. .PARAMETER Files An array of files. W...
PowerShellCorpus/PowerShellGallery/FileArchiver/1.0.40/IsAllowedDate.ps1
IsAllowedDate.ps1
param( # Parameter help description [Parameter(Mandatory=$true)] [Datetime] $Date, [Parameter()] [Datetime] $BaseDate = (Get-Date) ) $currentQuarter = Get-Date -year $BaseDate.Year -Month ([Math]::Ceiling($BaseDate.Month /3) * 3 - 2) -Day 1 $currentYear = Get-Date -Year $BaseDate.Y...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIObject.ps1
Get-ADSIObject.ps1
function Get-ADSIObject { <# .SYNOPSIS This function will query any kind of object in Active Directory .DESCRIPTION This function will query any kind of object in Active Directory .PARAMETER SamAccountName Specify the SamAccountName of the object. This parameter also search in Name and DisplayName pro...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Set-ADSIUserPassword.ps1
Set-ADSIUserPassword.ps1
function Set-ADSIUserPassword { PARAM( [parameter(Mandatory=$true)] $Identity, [parameter(Mandatory=$true)] $Password, [Alias("RunAs")] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCred...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSITokenGroup.ps1
Get-ADSITokenGroup.ps1
function Get-ADSITokenGroup { <# .SYNOPSIS Retrieve the list of group present in the tokengroups of a user or computer object. .DESCRIPTION Retrieve the list of group present in the tokengroups of a user or computer object. TokenGroups attribute https://msdn.microsoft.com/en-us/library/ms680275%...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSISiteLink.ps1
Get-ADSISiteLink.ps1
function Get-ADSISiteLink { <# .SYNOPSIS Function to retrieve the Active Directory Site Link(s) .DESCRIPTION Function to retrieve the Active Directory Site Link(s) .PARAMETER Credential Specifies alternative credential to use. Default is the current user. .PARAMETER ForestName Specifies t...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSISchema.ps1
Get-ADSISchema.ps1
function Get-ADSISchema { <# .SYNOPSIS The Get-ADSISchema function gather information about the current Active Directory Schema .DESCRIPTION The Get-ADSISchema function gather information about the current Active Directory Schema .PARAMETER PropertyType Specify the type of property to return ...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/New-ADSIComputer.ps1
New-ADSIComputer.ps1
function New-ADSIComputer { <# .SYNOPSIS function to create a new computer .DESCRIPTION function to create a new computer .PARAMETER Name Specifies the property Name .PARAMETER DisplayName Specifies the property DisplayName .PARAMETER Description Specifies the property Description...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIFsmo.ps1
Get-ADSIFsmo.ps1
function Get-ADSIFsmo { <# .SYNOPSIS Function to retrieve the Flexible single master operation (FSMO) roles owner(s) .DESCRIPTION Function to retrieve the Flexible single master operation (FSMO) roles owner(s) .PARAMETER Credential Specifies the Alternative credential to use .PARAMETER Fores...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/New-ADSISiteSubnet.ps1
New-ADSISiteSubnet.ps1
function New-ADSISiteSubnet { <# .SYNOPSIS Function to create a new Site Subnet .DESCRIPTION Function to create a new Site Subnet .PARAMETER SubnetName Specifies the SubnetName. Example '192.168.8.0/24' .PARAMETER SiteName Specifies the SiteName where the subnet will be assigned ....
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/New-ADSIDirectoryEntry.ps1
New-ADSIDirectoryEntry.ps1
function New-ADSIDirectoryEntry { <# .SYNOPSIS Function to create a DirectoryEntry instance .DESCRIPTION Function to create a DirectoryEntry instance This function is typically a helper function used by some of the other functions in the module ADSIPS .PARAMETER Path The path of this Direct...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIComputerSite.ps1
Get-ADSIComputerSite.ps1
function Get-ADSIComputerSite { <# .SYNOPSIS Function to retrieve the AD Site of a Computer .DESCRIPTION Function to retrieve the AD Site of a Computer This function does not rely on the .NET Framework to retrieve the information http://www.pinvoke.net/default.aspx/netapi32.dsgetsitename ...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIObject2.ps1
Get-ADSIObject2.ps1
function Get-ADSIObject { <# .NOTES Francois-Xavier.Cat LazyWinAdmin.com @lazywinadm github.com/lazywinadmin #> [CmdletBinding()] PARAM( [parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, ValueFromPipeline=$true)] $Identity, [Alias("RunAs")] [System.Mana...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIGroup.ps1
Get-ADSIGroup.ps1
function Get-ADSIGroup { <# .SYNOPSIS Function to retrieve a group in Active Directory .DESCRIPTION Function to retrieve a group in Active Directory .PARAMETER Identity Specifies the Identity of the group You can provide one of the following properties DistinguishedName Guid Name SamAccountN...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Test-ADSIUserIsLockedOut.ps1
Test-ADSIUserIsLockedOut.ps1
function Test-ADSIUserIsLockedOut { <# .SYNOPSIS Function to test if a User is LockedOut .DESCRIPTION Function to test if a User is LockedOut .PARAMETER Identity Specifies the Identity .PARAMETER Credential Specifies alternative credential .EXAMPLE Test-ADSIUserIsLockedOut -Identi...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Remove-ADSIGroupMember.ps1
Remove-ADSIGroupMember.ps1
function Remove-ADSIGroupMember { <# .SYNOPSIS Function to Remove a group member .DESCRIPTION Function to Remove a group member .PARAMETER Identity Specifies the Identity of the group You can provide one of the following properties DistinguishedName Guid Name ...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIComputer.ps1
Get-ADSIComputer.ps1
function Get-ADSIComputer { <# .SYNOPSIS Function to retrieve a Computer in Active Directory .DESCRIPTION Function to retrieve a Computer in Active Directory .PARAMETER Identity Specifies the Identity of the computer You can provide one of the following: DistinguishedName Guid ...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIOrganizationalUnit.ps1
Get-ADSIOrganizationalUnit.ps1
function Get-ADSIOrganizationalUnit { <# .SYNOPSIS This function will query Active Directory for Organization Unit Objects .PARAMETER Name Specify the Name of the OU .PARAMETER DistinguishedName Specify the DistinguishedName path of the OU .PARAMETER All Will show all the OU in the domain .PAR...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIForestDomain.ps1
Get-ADSIForestDomain.ps1
Function Get-ADSIForestDomain { [cmdletbinding()] PARAM ( [Alias("RunAs")] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty, $ForestName = [System.DirectoryServices.ActiveDirectory.Forest]::Ge...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIReplicaDomainInfo.ps1
Get-ADSIReplicaDomainInfo.ps1
function Get-ADSIReplicaDomainInfo { <# .SYNOPSIS Get-ADSIReplicaDomainInfo returns information about the connected DC's Domain. .DESCRIPTION Get-ADSIReplicaDomainInfo returns information about the connected DC's Domain. .PARAMETER ComputerName Defines the remote computer to...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIGroupPolicyObject.ps1
Get-ADSIGroupPolicyObject.ps1
function Get-ADSIGroupPolicyObject { <# .SYNOPSIS This function will query Active Directory Group Policy Objects .PARAMETER Credential Specify the Credential to use .PARAMETER DomainDistinguishedName Specify the DistinguishedName of the Domain to query .PARAMETER SizeLimit Specify the nu...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Get-ADSIForest.ps1
Get-ADSIForest.ps1
function Get-ADSIForest { <# .SYNOPSIS Function to retrieve the current or specified forest .DESCRIPTION Function to retrieve the current or specified forest .PARAMETER Credential Specifies alternative credential to use .PARAMETER ForestName Specifies the ForestName to query .EXAMPLE...
PowerShellCorpus/PowerShellGallery/AdsiPS/1.0.0.2/Public/Remove-ADSISite.ps1
Remove-ADSISite.ps1
Function Remove-ADSISite { <# .SYNOPSIS function to remove a Site .DESCRIPTION function to remove a Site .PARAMETER SiteName Specifies the Site Name .PARAMETER Credential Specifies the alternative credential to use. By default it will use the current user windows credentials. .PAR...