full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/Invoke-ScriptBlockWithRetry.ps1
Invoke-ScriptBlockWithRetry.ps1
<# .SYNOPSIS Executes a ScriptBlock with Retry .DESCRIPTION Wraps a ScriptBlock in a try/catch to allow for retrying based on specific exceptions as defined in the retry policy passed. To create a retry policy object see New-RetryPolicy cmdlet. .EXAMPLE PS> $policy = New-RetryPolicy -Policy Linear -...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/New-RetryPolicy.ps1
New-RetryPolicy.ps1
<# .SYNOPSIS Creates a custom Retry Policy for use with Invoke-ScriptBlockWithRetry cmdlet .DESCRIPTION Creates a custom Retry Policy for use with Invoke-ScriptBlockWithRetry. Resulting object contains the required information to detect and retry appropriately. .EXAMPLE PS> $policy = New-RetryPolicy -...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/New-ConsoleColorSet.ps1
New-ConsoleColorSet.ps1
<# .SYNOPSIS Creates a color set object. Foreground and background. .DESCRIPTION Creates a pair foreground and background color which express a given console format color to use with Out-ColorFormat cmdlet. .EXAMPLE PS> New-ConsoleColorSet -ForegroundColor Yellow Returns an object which expres...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/Set-ConsoleTransparency.ps1
Set-ConsoleTransparency.ps1
<# .SYNOPSIS Sets console transparency .DESCRIPTION Adjust the console transparency to a given level .EXAMPLE PS> Set-ConsoleTransparency Sets console transparency to default level of 220 .EXAMPLE PS> Set-ConsoleTransparency -Off Disables console transparency .EXAMPLE PS> Set-ConsoleTranspar...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/Add-ExpiringCacheItem.ps1
Add-ExpiringCacheItem.ps1
<# .SYNOPSIS PowerShell implementation for Expiring Cache .DESCRIPTION Takes a ScriptBlock as execution and expiration policy. ScriptBlock is stored along with its expiration policy. Upon access, expiration policy is assessed. On expiration the given ScriptBlock is executed and the value is retrieve...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/Out-ColorFormat.ps1
Out-ColorFormat.ps1
<# .SYNOPSIS Display specific words or rows in given colors .DESCRIPTION Takes a string as input and displays the given words in the specified color. Or rows in a series of given colors .EXAMPLE PS> $cs = @() PS> $cs += (New-ConsoleColorSet -ForegroundColor Green) PS> $cs += (New-ConsoleColorSet -Foregr...
PowerShellCorpus/PowerShellGallery/xUtility/1.0.15/Main/Set-WindowSize.ps1
Set-WindowSize.ps1
<# .SYNOPSIS Sets the current console window to a specified size .DESCRIPTION Sets the current console window to a specified size. Alternatively it can be maximized. .EXAMPLE PS> Set-WindowSize -Height 60 -Width 130 Sets the console window to the given dimensions .EXAMPLE PS> Set-WindowSize ...
PowerShellCorpus/PowerShellGallery/Fmg-KeePass/0.1.0/Export-KeePassBinary.ps1
Export-KeePassBinary.ps1
function Export-KeePassBinary() { <# .SYNOPSIS Exports a binary file from a KeePass Entry object .DESCRIPTION This method will write the binary information associated with a KeePass entry. Each association is stored with the file's name and extension e.g. cert.pfx .PARAMETER En...
PowerShellCorpus/PowerShellGallery/Fmg-KeePass/0.1.0/Open-KeePassPackage.ps1
Open-KeePassPackage.ps1
if((Get-Command New-KeePassKey -ErrorAction SilentlyContinue) -eq $null) { . "$PSScriptRoot\New-KeePassKey.ps1" } function Open-KeePassPackage() { <# .SYNOPSIS Creates a new KeePass master key .DESCRIPTION The master key is a composite key that are required to open KeePass database...
PowerShellCorpus/PowerShellGallery/Fmg-KeePass/0.1.0/Find-KeePassEntry.ps1
Find-KeePassEntry.ps1
if((Get-Command New-KeePassKey -ErrorAction SilentlyContinue) -eq $null) { . "$PSScriptRoot\New-KeePassKey.ps1" } function Find-KeePassEntry() { <# .SYNOPSIS Searches for the all the entries in the KeePass database with that match the given field. .DESCRIPTION This method allows fo...
PowerShellCorpus/PowerShellGallery/Fmg-KeePass/0.1.0/Find-KeePassEntryByTitle.ps1
Find-KeePassEntryByTitle.ps1
if((Get-Command New-KeePassKey -ErrorAction SilentlyContinue) -eq $null) { . "$PSScriptRoot\New-KeePassKey.ps1" } function Find-KeePassEntryByTitle() { <# .SYNOPSIS Searches for the first entry in the KeePass database with a match on the given title .DESCRIPTION This method does a ...
PowerShellCorpus/PowerShellGallery/Fmg-KeePass/0.1.0/New-KeePassKey.ps1
New-KeePassKey.ps1
if([Type]::GetType("NerdyMishka.KeePass.Search") -eq $null) { if($PSVersionTable.PSEdition -eq "Core") { Write-Error "Not supported ... yet" } else { [System.Reflection.Assembly]::LoadFile("$PSScriptRoot\bin\net452\NerdyMishka.BitsAndPieces.dll") | Write-Debug [System.Reflection...
PowerShellCorpus/PowerShellGallery/PKITools/1.6/HelperFunctions.ps1
HelperFunctions.ps1
function Get-Domain { <# .Synopsis Return the current domain .DESCRIPTION Use .net to get the current domain .EXAMPLE Get-Domain #> [CmdletBinding()] [OutputType([System.DirectoryServices.ActiveDirectory.Domain])] Pa...
PowerShellCorpus/PowerShellGallery/PKITools/1.6/Get-IssuedCertificates.ps1
Get-IssuedCertificates.ps1
function Get-IssuedCertificate { <# .SYNOPSIS Get Issued Certificate data from one or more certificate athorities. .DESCRIPTION Can get various certificate fileds from the Certificate Authority database. Usfull for exporting certificates or checking what is ...
PowerShellCorpus/PowerShellGallery/PKITools/1.6/Get-CertificateAuthority.ps1
Get-CertificateAuthority.ps1
function Get-CertificatAuthority { <# .Synopsis Get list of Certificate Authorities from Active directory .DESCRIPTION Queries Active Directory for Certificate Authorities with Enrollment Services enabled .EXAMPLE Get-CertificatAuthority .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/PKITools/1.6/Get-CertificateTemplateOID.ps1
Get-CertificateTemplateOID.ps1
function Get-CertificateTemplateOID { <# .Synopsis returns a PKI template OID .DESCRIPTION Connects to LDAP and retrievs the OID of a given PKI template by template Common Name .EXAMPLE Get-CertificateTemplateOID -Name 'DSCTemplate' ...
PowerShellCorpus/PowerShellGallery/xDismFeature/1.2.0.0/Example/Example_WithSource.ps1
Example_WithSource.ps1
Configuration DismWithWrongSource { Import-DscResource -ModuleName xDismFeature Node "localhost" { xDismFeature DismFeatureWithSource1 { Ensure = "Present" Name = "NetFx3" Source = "asd" } } } Configuration DismWithoutSource { ...
PowerShellCorpus/PowerShellGallery/VMware.VumAutomation/6.5.1.5301639/VMware.VumAutomation.ps1
VMware.VumAutomation.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.VumAutomation", (Split-Path $script:MyInvocation.MyCommand.Path)); function global:Get-VumCommand([string] $Name = "*") { Get-Command -Module VMware.VumAutomation -Name $Name } set-alias Attach-Baseline...
PowerShellCorpus/PowerShellGallery/Posh-SYSLOG/2.0.4/Posh-SYSLOG.Tests.ps1
Posh-SYSLOG.Tests.ps1
Import-Module $PSScriptRoot\Posh-SYSLOG.psm1 -Force Stop-Job -Name SyslogTest1 -ErrorAction SilentlyContinue Remove-Job -Name SyslogTest1 -Force -ErrorAction SilentlyContinue Describe 'Send-SyslogMessage' { Mock -ModuleName Posh-SYSLOG Get-Date { return (New-Object datetime(2000,1,1)) } Mock -ModuleNam...
PowerShellCorpus/PowerShellGallery/Posh-SYSLOG/2.0.4/Functions/Send-SyslogMessage.ps1
Send-SyslogMessage.ps1
#requires -Version 2 -Modules NetTCPIP enum Syslog_Facility { kern user mail daemon auth syslog lpr news uucp clock authpriv ftp ntp logaudit logalert cron local0 local1 local2 local3 local4 local5 local6 local7 } enum Syslog_Severity { Emergency Alert Critic...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/New-KPEntry.ps1
New-KPEntry.ps1
#.ExternalHelp psKeePass.Help.xml function New-KPEntry { # http://technet.microsoft.com/en-us/library/hh847872.aspx [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false #HelpUri = 'http://w...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/Remove-KPEntry.ps1
Remove-KPEntry.ps1
#.ExternalHelp psKeePass.Help.xml function Remove-KPEntry { # http://technet.microsoft.com/en-us/library/hh847872.aspx [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false #HelpUri = 'http:...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/TabExpansion.ps1
TabExpansion.ps1
try { Import-Module -Name TabExpansionPlusPlus -ea Ignore if (Get-Command Register-ArgumentCompleter -Module TabExpansionPlusPlus -ea Ignore) { # http://www.powertheshell.com/dynamicargumentcompletion/ # https://github.com/lzybkr/TabExpansionPlusPlus $cmdlets = @('Get-KPEntry'...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/Get-KPEntry.ps1
Get-KPEntry.ps1
#.ExternalHelp psKeePass.Help.xml function Get-KPEntry { # http://technet.microsoft.com/en-us/library/hh847872.aspx [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false #HelpUri = 'http://w...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/Set-KPEntry.ps1
Set-KPEntry.ps1
#.ExternalHelp psKeePass.Help.xml function Set-KPEntry { # http://technet.microsoft.com/en-us/library/hh847872.aspx [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false #HelpUri = 'http://w...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/common/Write-Log.ps1
Write-Log.ps1
#region Log File Management $logLocalAppDir = Join-Path $Script:mInfo.ModuleBase logs $logName = "$($Script:mInfo.Name).log" $logFullName = Join-Path $logLocalAppDir $logName $MaxLogFileSizeMB = 5 # After a log file reaches this size it will archive the existing and create a new one trap [Exception] { ...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/common/generic.ps1
generic.ps1
#Convert a text from the DOS format to the UNIX format. #The format is different in the last character of each line. #The DOS format ends with a carriage return (Cr) line feed (Lf) #character whereas the UNIX format uses the line feed (Lf) character. function ConvertTo-Unix { begin {} process ...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/common/specific.ps1
specific.ps1
#.ExternalHelp ..\psKeePass.Help.xml function Format-PwEntry { Param ( [Parameter(Mandatory=$false,ValueFromPipeline=$True)] $PwEntry, [Switch]$ForcePlainText, $CompositeKey, $ConnectionInfo ) $PwEntry.Strings | % { ...
PowerShellCorpus/PowerShellGallery/psKeePass/0.0.0.7/common/Credential.ps1
Credential.ps1
#region PSTip Storing of credentials # http://www.powershellmagazine.com/2012/10/30/pstip-storing-of-credentials/ #.ExternalHelp ..\psKeePass.Help.xml function New-SecurePassword { [CmdletBinding()] param( [Parameter(Mandatory = $true, Position = 1)] ...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Misc/New-DnsServerSecondaryZone.ps1
New-DnsServerSecondaryZone.ps1
$Properties = @{ Name = New-xDscResourceProperty -Name Name -Type String -Attribute Key ` -Description 'Name of the secondary zone' DnsServer = New-xDscResourceProperty -Name MasterServerIPAddress -Type String[] -Attribute Requ...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Misc/New-DnsServerZoneTransfer.ps1
New-DnsServerZoneTransfer.ps1
$Properties = @{ Name = New-xDscResourceProperty -Name Name -Type String -Attribute Key ` -Description 'Name of the secondary zone' Type = New-xDscResourceProperty -Name Type -Type String -Attribute Required -ValidateSet 'Any',...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Tests/Unit/MSFT_xDnsRecord.Tests.ps1
MSFT_xDnsRecord.Tests.ps1
$Global:DSCModuleName = 'xDnsServer' # Example xNetworking $Global:DSCResourceName = 'MSFT_xDnsRecord' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Pat...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Tests/Unit/MSFT_xDnsServerForwarder.Tests.ps1
MSFT_xDnsServerForwarder.Tests.ps1
$Global:DSCModuleName = 'xDnsServer' $Global:DSCResourceName = 'MSFT_xDnsServerForwarder' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource....
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Tests/Unit/MSFT_xDnsServerZoneTransfer.Tests.ps1
MSFT_xDnsServerZoneTransfer.Tests.ps1
$Global:DSCModuleName = 'xDnsServer' $Global:DSCResourceName = 'MSFT_xDnsServerZoneTransfer' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResour...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Tests/Unit/MSFT_xDnsServerPrimaryZone.Tests.ps1
MSFT_xDnsServerPrimaryZone.Tests.ps1
$Global:DSCModuleName = 'xDnsServer' $Global:DSCResourceName = 'MSFT_xDnsServerPrimaryZone' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResourc...
PowerShellCorpus/PowerShellGallery/xDnsServer/1.7.0.0/Tests/Unit/MSFT_xDnsServerADZone.Tests.ps1
MSFT_xDnsServerADZone.Tests.ps1
$Global:DSCModuleName = 'xDnsServer' $Global:DSCResourceName = 'MSFT_xDnsServerADZone' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tes...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Private/Out-DataTable.ps1
Out-DataTable.ps1
<# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-psdrive| Out-DataTable This example creates a DataTable from the proper...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/New-WPFMessageBox.ps1
New-WPFMessageBox.ps1
function New-WPFMessageBox { <# .SYNOPSIS The New-WPFMessageBox functio will show a message box to the user .DESCRIPTION The New-WPFMessageBox functio will show a message box to the user .PARAMETER Message Specifies the message to show .PARAMETER Title Specifies the title of the message b...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Set-WPFWindow.ps1
Set-WPFWindow.ps1
function Set-WPFWindow { <# .SYNOPSIS Function to set properties on the Window Control .DESCRIPTION Function to set properties on the Window Control .PARAMETER Window Specifies the Window Control .PARAMETER Title Specifies the Title to set on the Window .EXAMPLE PS C:\> Set-WPFWin...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Remove-WPFDataGridtem.ps1
Remove-WPFDataGridtem.ps1
function Remove-WPFDataGridItem { <# .SYNOPSIS This function remove a row to a DataGrid .DESCRIPTION This function remove a row to a DataGrid .PARAMETER DataGridView Specifies the DataGridView Control to use .PARAMETER SelectedItems Specifies that the selectedItems will be removed ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/New-WPFOpenFileDialog.ps1
New-WPFOpenFileDialog.ps1
function New-WPFOpenFileDialog { <# .SYNOPSIS The New-WFOpenFileDialog function will ask the user to select one of multiple files. The function will return the literal path of the file(s) selected .DESCRIPTION The New-WFOpenFileDialog function will ask the user to select one of multiple files. The ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/New-WPFSpeakerBeep.ps1
New-WPFSpeakerBeep.ps1
function New-WPFSpeakerBeep { <# .SYNOPSIS The New-WPFSpeakerBeep function plays the sound of a beep of a specified frequency and duration through the console speaker. .DESCRIPTION The New-WPFSpeakerBeep function plays the sound of a beep of a specified frequency and duration through the console speaker....
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Enable-WPFButton.ps1
Enable-WPFButton.ps1
function Enable-WPFButton { <# .SYNOPSIS Function to Enable a Button control .DESCRIPTION Function to Enable a Button control .PARAMETER Button Specifies the Button Control .EXAMPLE PS C:\> Enable-WPFButton -Button $Button1 .NOTES Francois-Xavier Cat lazywinadmin.com @lazywi...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Update-WPFDataGrid.ps1
Update-WPFDataGrid.ps1
function Update-WPFDataGrid { <# .SYNOPSIS Function to refresh the content of a DataGrid control .DESCRIPTION Function to refresh the content of a DataGrid control .PARAMETER DataGrid Specifies the DataGrid control to update .NOTES Author: Francois-Xavier Cat Twitter:@LazyWinAdm www...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Import-WPFDataGrid.ps1
Import-WPFDataGrid.ps1
function Import-WPFDataGrid { <# .SYNOPSIS Function to load multiple items into a DataGrid control. .DESCRIPTION Function to load multiple items into a DataGrid control. The object that you are passing to the Item parameter will be converted to a Datatable object .PARAMETER DataGrid Spec...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Clear-WPFDataGrid.ps1
Clear-WPFDataGrid.ps1
function Clear-WPFDataGrid { <# .SYNOPSIS This function will clear the content of a DataGrid control .DESCRIPTION This function will clear the content of a DataGrid control .PARAMETER RichTextBox A description of the DataGrid parameter. .EXAMPLE Clear-WPFDataGrid -DataGrid $DataGrid ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Remove-WPFComboBoxItem.ps1
Remove-WPFComboBoxItem.ps1
function Remove-WPFComboBoxItem { <# .SYNOPSIS Function to Remove items from a ComboBox .DESCRIPTION Function to Remove items from a ComboBox System.windows.controls.combobox https://msdn.microsoft.com/en-us/library/system.windows.controls.combobox(v=vs.110).aspx .PARAMETER ComboBox Spec...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Disable-WPFButton.ps1
Disable-WPFButton.ps1
function Disable-WPFButton { <# .SYNOPSIS Function to disable a Button control .DESCRIPTION Function to disable a Button control .PARAMETER Button Specifies the Button Control .EXAMPLE PS C:\> Disable-WPFButton -Button $Button1 .NOTES Francois-Xavier Cat lazywinadmin.com @la...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Set-WPFProgressBar.ps1
Set-WPFProgressBar.ps1
function Set-WPFProgressBar { <# .SYNOPSIS Function to change ProgressBar Control .DESCRIPTION Function to change ProgressBar Control .PARAMETER ProgressBar Specifies the ProgressBar control .PARAMETER Value Specifies the Percentage of progress .NOTES Francois-Xavier Cat lazywi...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/New-WPFOpenFolderDialog.ps1
New-WPFOpenFolderDialog.ps1
function New-WPFOpenFolderDialog { <# .SYNOPSIS The New-WPFOpenFolderDialog function will ask the user to select one folder. .DESCRIPTION The New-WPFOpenFolderDialog function will ask the user to select one folder. .PARAMETER Description Specifies a message to help the user select a folder ....
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Add-WPFDataGridRow.ps1
Add-WPFDataGridRow.ps1
function Add-WPFDataGridRow { <# .SYNOPSIS This function add a row to a DataGrid .DESCRIPTION This function add a row to a DataGrid By default it will add an empty row (if -values is not specified) .PARAMETER DataGrid Specifies the DataGrid Control to use .PARAMETER Values Spec...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Get-WPFTextBoxText.ps1
Get-WPFTextBoxText.ps1
function Get-WPFTextBoxText { <# .SYNOPSIS Function to get the text from the TextBox Control .DESCRIPTION Function to get the text from the TextBox Control .PARAMETER TextBox Specifies the TextBox Control .EXAMPLE PS C:\> Get-WPFTextBoxText -TextBox $TextBox1 .NOTES Francois-Xavie...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/New-WPFInputBox.ps1
New-WPFInputBox.ps1
function New-WPFInputBox { <# .SYNOPSIS The New-WPFInputBox function will prompt the user for input in a window. .DESCRIPTION The New-WPFInputBox function will prompt the user for input in a window. .PARAMETER Message Specifies the question you want to ask to the user. .PARAMETER Title Sp...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Clear-WPFListBox.ps1
Clear-WPFListBox.ps1
function Clear-WPFListBox { <# .SYNOPSIS function to clear the content of a Listbox .DESCRIPTION function to clear the content of a Listbox .PARAMETER ListBox Specifies the ListBox control to clear .EXAMPLE PS C:\> Clear-WPFListBox -ListBox $ListBox01 .NOTES Francois-Xavier Cat ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Show-WPFWindow.ps1
Show-WPFWindow.ps1
function Show-WPFWindow { <# .SYNOPSIS Function to show the Window .DESCRIPTION Function to show the Window .PARAMETER Window Specifies the Window to Show .EXAMPLE PS C:\> Show-WPFWindow -Window $Window .NOTES Francois-Xavier Cat lazywinadmin.com @lazywinadm github.com/la...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Add-WPFListBoxItem.ps1
Add-WPFListBoxItem.ps1
function Add-WPFListBoxItem { <# .SYNOPSIS Function to add items from a Listbox .DESCRIPTION Function to add items from a Listbox. System.windows.controls.listbox https://msdn.microsoft.com/en-us/library/system.windows.controls.listbox(v=vs.110).aspx .PARAMETER ListBox Specifies the Lis...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Remove-WPFListBoxItem.ps1
Remove-WPFListBoxItem.ps1
function Remove-WPFListBoxItem { <# .SYNOPSIS Function to remove items from a Listbox .DESCRIPTION Function to remove items from a Listbox System.windows.controls.listbox https://msdn.microsoft.com/en-us/library/system.windows.controls.listbox(v=vs.110).aspx .PARAMETER ListBox Specifies...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Enable-WPFTextBox.ps1
Enable-WPFTextBox.ps1
function Enable-WPFTextBox { <# .SYNOPSIS Function to Enable a TextBox Control .DESCRIPTION Function to Enable a TextBox Control .PARAMETER TextBox Specifies the TextBox Control .EXAMPLE PS C:\> Enable-WPFTextBox -Textbox $TextBox1 .NOTES Francois-Xavier Cat lazywinadmin.com ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Clear-WPFRichTextBox.ps1
Clear-WPFRichTextBox.ps1
function Clear-WPFRichTextBox { <# .SYNOPSIS This function will clear the content of a richtextbox control .DESCRIPTION This function will clear the content of a richtextbox control .PARAMETER RichTextBox Specifies the RichTextBox control .EXAMPLE Clear-WPFRichTextBox -RichTextBox $RichTe...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Set-WPFTextBoxText.ps1
Set-WPFTextBoxText.ps1
function Set-WPFTextBoxText { <# .SYNOPSIS function to set the Text property on a TextBox control .DESCRIPTION function to set the Text property on a TextBox control .PARAMETER TextBox Specifies the TExtBox Control .PARAMETER Text Specifies the Text property value .EXAMPLE PS C:\>...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Set-WPFWindowVariable.ps1
Set-WPFWindowVariable.ps1
Function Set-WPFWindowVariable { <# .SYNOPSIS Function to generate the Control Variables .DESCRIPTION Function to generate the Control Variables .PARAMETER Window Specifies the Window .PARAMETER XAML Specifies the XAML used .PARAMETER Prefix Specifies the Prefix of each Variable, ...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Set-WPFListBox.ps1
Set-WPFListBox.ps1
function Set-WPFListBox { <# .SYNOPSIS Function to edit the behavior of a ListBox Control .DESCRIPTION Function to edit the behavior of a ListBox Control .PARAMETER ListBox Specifies the ListBox control .PARAMETER ScrollToCaret Specifies that you want the listbox to go to the bottom of th...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Disable-WPFTextBox.ps1
Disable-WPFTextBox.ps1
function Disable-WPFTextBox { <# .SYNOPSIS Function to disable a TextBox Control .DESCRIPTION Function to disable a TextBox Control .PARAMETER TextBox Specifies the TextBox Control .EXAMPLE PS C:\> Disable-WPFTextBox -Textbox $TextBox1 .NOTES Francois-Xavier Cat lazywinadmin.co...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Add-WPFComboBoxItem.ps1
Add-WPFComboBoxItem.ps1
function Add-WPFComboBoxItem { <# .SYNOPSIS Function to add items from a ComboBox .DESCRIPTION Function to add items from a ComboBox System.windows.controls.combobox https://msdn.microsoft.com/en-us/library/system.windows.controls.combobox(v=vs.110).aspx .PARAMETER ComboBox Specifies the...
PowerShellCorpus/PowerShellGallery/WPFPS/1.0.0.0/Public/Get-WPFListBoxItem.ps1
Get-WPFListBoxItem.ps1
function Get-WPFListBoxItem { <# .SYNOPSIS Function to retrieve items from a ListBox Control .DESCRIPTION Function to retrieve items from a ListBox Control .PARAMETER ListBox Specifies the ListBox control .PARAMETER Selected Retrieve only the selected items .PARAMETER All Retrieve...
PowerShellCorpus/PowerShellGallery/AzureStackVaaS/2.0.0/Automation/LaunchVaaSTests.ps1
LaunchVaaSTests.ps1
##----------------------------------------------------------------------- ## <copyright file="LaunchVaaSTests.ps1" company="Microsoft Corp."> ## Copyright (c) Microsoft Corp. All rights reserved. ## </copyright> ##----------------------------------------------------------------------- <# .SYNOPSIS Launch...
PowerShellCorpus/PowerShellGallery/xSystemSecurity/1.2.0.0/Tests/Unit/MSFT_xFileSystemAccessRule.tests.ps1
MSFT_xFileSystemAccessRule.tests.ps1
$script:DSCModuleName = 'xSystemSecurity' $script:DSCResourceName = 'MSFT_xFileSystemAccessRule' [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Pat...
PowerShellCorpus/PowerShellGallery/xSystemSecurity/1.2.0.0/Tests/Integration/MSFT_xFileSystemAccessRule.integration.tests.ps1
MSFT_xFileSystemAccessRule.integration.tests.ps1
$script:DSCModuleName = 'xSystemSecurity' $script:DSCResourceName = 'MSFT_xFileSystemAccessRule' [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Pa...
PowerShellCorpus/PowerShellGallery/xSystemSecurity/1.2.0.0/Tests/Integration/MSFT_xFileSystemAccessRule.config.ps1
MSFT_xFileSystemAccessRule.config.ps1
configuration MSFT_xFileSystemAccessRule_NewRule { Import-DscResource -ModuleName 'xSystemSecurity' node localhost { xFileSystemAccessRule Integration_Test { Path = "$($env:SystemDrive)\SampleFolder" Identity = "NT AUTHORITY\NETWORK SERVICE" Rights = @("Read","S...
PowerShellCorpus/PowerShellGallery/OledbSql/1.0.3/tests/OledbSql.Tests.ps1
OledbSql.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module (Join-Path $here '..\OledbSql.psd1') # Find the latest version of the ACE data provider, for the connection string. $ProviderVersion = (New-Object System.Data.OleDb.OleDbEnumerator).GetElements() | Foreach { if ($_.SOURCES_NAME -match '...
PowerShellCorpus/PowerShellGallery/Posh-Sysmon/0.7.5/Filters.ps1
Filters.ps1
# .ExternalHelp Posh-SysMon.psm1-Help.xml function New-SysmonImageLoadFilter { [CmdletBinding(DefaultParameterSetName = 'Path', HelpUri = 'https://github.com/darkoperator/Posh-Sysmon/blob/master/docs/New-SysmonImageLoadFilter.md')] Param ( # Path to XML config file. [Parameter(Mandato...
PowerShellCorpus/PowerShellGallery/Posh-Sysmon/0.7.5/Config.ps1
Config.ps1
# .ExternalHelp Posh-SysMon.psm1-Help.xml function New-SysmonConfiguration { [CmdletBinding(HelpUri = 'https://github.com/darkoperator/Posh-Sysmon/blob/master/docs/New-SysmonConfiguration.md')] Param ( # Path to write XML config file. [Parameter(Mandatory=$true, ...
PowerShellCorpus/PowerShellGallery/PSAlphaFS/2.0.0.1/PSAlphaFS.tests.ps1
PSAlphaFS.tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 # Describe "Get-Function" { Context "Function Exists" { It "Should Return" { } } }
PowerShellCorpus/PowerShellGallery/PSAlphaFS/2.0.0.1/build.ps1
build.ps1
Publish-Module -Path "C:\Github\Public\dev\PSAlphaFS" -NuGetApiKey mykey
PowerShellCorpus/PowerShellGallery/PSAlphaFS/2.0.0.1/Helpers/PSAlphaFSHelpers.ps1
PSAlphaFSHelpers.ps1
Function GetDotNetVer { #https://gallery.technet.microsoft.com/scriptcenter/Detect-NET-Framework-120ec923 #modified to work with this module [cmdletbinding()] param() $dotNetRegistry = 'SOFTWARE\Microsoft\NET Framework Setup\NDP' $dotNet4Registry = 'SOFTWARE\Microsoft\NET Framework Setup\...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/SupplierSpecific_Functions/Get-UKPowerCutsNieNetworks.ps1
Get-UKPowerCutsNieNetworks.ps1
function Get-UKPowerCutsWesternPower { Param ( [Parameter(Mandatory=$true)][ValidatePattern("^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ))$"...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/SupplierSpecific_Functions/Get-UKPowerCutsWesternPower.ps1
Get-UKPowerCutsWesternPower.ps1
function Get-UKPowerCutsWesternPower { Param ( [Parameter(Mandatory=$true)][ValidatePattern("^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ))$"...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/SupplierSpecific_Functions/Get-UKPowerCutsScottishAndSouthern.ps1
Get-UKPowerCutsScottishAndSouthern.ps1
function Get-UKPowerCutsScottishAndSouthern { Param ( [Parameter(Mandatory = $true)][ValidatePattern("^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/SupplierSpecific_Functions/Get-UKPowerCutsSPEnergyNetworks.ps1
Get-UKPowerCutsSPEnergyNetworks.ps1
function Get-UKPowerCutsSPEnergyNetworks { Param ( [Parameter(Mandatory=$true)][ValidatePattern("^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/SupplierSpecific_Functions/Get-UKPowerCutsUKPowerNetworks.ps1
Get-UKPowerCutsUKPowerNetworks.ps1
function Get-UKPowerCutsUKPowerNetworks { Param ( [Parameter(Mandatory=$true)][ValidatePattern("^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ)...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/Main_Functions/Get-UKPowerCutsChecker.ps1
Get-UKPowerCutsChecker.ps1
function Get-UKPowerCutsChecker { <# .SYNOPSIS "Get-UKPowerCutsChecker" function has been created to give an information about power outages. "Get-UKPowerCutsChecker" is the main function of the module. .DESCRIPTION "Get-UKPowerCutsChecker" allows you to check if there is any power cu...
PowerShellCorpus/PowerShellGallery/ukpowercutchecker/1.0.8/Public/Helper_Functions/Get-WebRequestTable.ps1
Get-WebRequestTable.ps1
Function Get-WebRequestTable { param( [Parameter(Mandatory = $true)] [String] $WebSite, [Parameter(Mandatory = $true)] [int] $TableNumber, [switch] $IeExperience ) ## Extract the tables out of the web request If ($IeExperience) { $ie = new-object -ComObject "InternetExplorer.Application"...
PowerShellCorpus/PowerShellGallery/OVF.SharePoint/1.0.0.3/Diagnostics/Simple/OVF.SharePoint.Tests.ps1
OVF.SharePoint.Tests.ps1
#Functions function Test-OPSValServiceState{ param( $serviceName, $computerName = "." ) if(($computerName -eq ".") -or ($computerName -eq "$env:computername") -or ($computerName -eq "localhost") -or ($computerName -eq "$env:computername.$env:USERDNSDOMAIN")){ $service = ...
PowerShellCorpus/PowerShellGallery/OVF.SharePoint/1.0.0.3/Diagnostics/Simple/OVF.SharePoint.EnterpriseSearch.Tests.ps1
OVF.SharePoint.EnterpriseSearch.Tests.ps1
function New-HostTemplate{ # Template object for the host array: $hostTemplate = New-Object -TypeName PSObject $hostTemplate | Add-Member -MemberType NoteProperty -Name hostName -Value $null $hostTemplate | Add-Member -MemberType NoteProperty -Name components -Value 0 $hostTemplate | Add-Member -Memb...
PowerShellCorpus/PowerShellGallery/AzureRM.EventHub/0.4.0/AzureRmProfileStartup.ps1
AzureRmProfileStartup.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/AzureRM.EventHub/0.2.0/AzureRmProfileStartup.ps1
AzureRmProfileStartup.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/PoshNuGet/0.1.40/deploy.ps1
deploy.ps1
<# .Author Trevor Sullivan <trevor@trevorsullivan.net> .Description Publishes the PowerShell module to the PowerShell Gallery. This PowerShell script is invoked by AppVeyor after the "Deploy" phase has completed successfully. #> function Patch-ModuleManifest { [CmdletBinding()] param ( [string] $Path , [...
PowerShellCorpus/PowerShellGallery/RackspaceCloudOffice/0.4.1/New-Release.ps1
New-Release.ps1
function Main { $module = Test-ModuleManifest .\RackspaceCloudOffice.psd1 [string] $version = $module.Version $d = New-TemporaryDirectory try { $moduleDir = New-Item -ItemType Directory -Path (Join-Path $d $module.Name) Copy-Item *.psd1 $moduleDir Copy-Item *.psm1 $moduleDir ...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/build.ps1
build.ps1
[cmdletbinding()] param( [string[]]$Task = 'default' # This task is defined in psakeBuild. We are just setting a default here. ) # Verify that we have PackageManagement module installed if (!(Get-Command Install-Module)) { throw 'PackageManagement is not installed. You need V5 or https://www.microsoft.com/e...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Test/PowerRails.psdeploy.ps1
PowerRails.psdeploy.ps1
# Upload to powershell gallery Deploy 'Upload to gallery' { # Get config file $root = Split-Path $PSScriptRoot -Parent try { $config = get-content "$root\config.json" | ConvertFrom-Json $moduleFolder = Join-Path "$root\dist" $config.name # Create and empty out dist file if (!(Test-Path $modu...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Test/psakeBuild.ps1
psakeBuild.ps1
properties { $powerrailsModule = Join-Path $root "PowerRails.psm1" } # Default task includes Analyzing and Testing of script task default -depends Analyze, Test # Analyze by running Invoke-ScriptAnalyzer. Check script against best known practices task Analyze { $saResults = Invoke-ScriptAnalyzer -Path "$root\Publ...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Test/PowerRails.test.ps1
PowerRails.test.ps1
# Determine our script root $root = Split-Path $PSScriptRoot -Parent # Load module via definition Import-Module $root\PowerRails.psd1 -Force # Run our module tests InModuleScope PowerRails { # Check that modules are installed Describe 'Load PowerRails' { It 'PowerRails modules is loaded' { $powerRailsMo...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Public/New-PowerRailsItem.ps1
New-PowerRailsItem.ps1
function New-PowerRailsItem { <# .SYNOPSIS Scaffold a powershell module or script based on best practices. .DESCRIPTION Scaffold a powershell module or script based on best practices. A folder will be created with required files to get you going. .PARAMETER name Name of your module or script. .PARAMETER type ...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Public/Utilities.ps1
Utilities.ps1
function Write-PowerRailsStatus { <# .SYNOPSIS Write PowerRails progress to host. .DESCRIPTION Write PowerRails progress to host. This function just makes the output a little prettier. .PARAMETER line The text that you want to appear in your console .PARAMETER type The type of output ...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Resources/Template.psdeploy.ps1
Template.psdeploy.ps1
# Deploy the script to the c:\scripts directory Deploy 'Copy to scripts folder' { By Filesystem { FromSource '.\' To "c:\scripts\$module" Tagged Prod } }
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Resources/Template.ps1
Template.ps1
<# .SYNOPSIS Write a synopsis here .DESCRIPTION Write a description here .EXAMPLE C:\PS> ./$name.ps1 .NOTES Author: $author CreateDate: $date #> # Generated command for testing. Can be removed Write-Output "Reporting from $name!"
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Resources/psakeBuild.ps1
psakeBuild.ps1
properties { $script = "$PSScriptRoot\$name.$fileType" } # Default task includes Analyzing and Testing of script task default -depends Analyze, Test # Analyze by running Invoke-ScriptAnalyzer. Check script against best known practices task Analyze { $saResults = Invoke-ScriptAnalyzer -Path $script -Severity @('Er...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Resources/build.ps1
build.ps1
[cmdletbinding()] param( [string[]]$Task = 'default' # This task is defined in psakeBuild. We are just setting a default here. ) # Verify that we have PackageManagement module installed if(!(Get-Command Install-Module)) { throw 'PackageManagement is not installed. You need V5 or https://www.microsoft.com/en-us/dow...
PowerShellCorpus/PowerShellGallery/PowerRails/0.0.9/Resources/Template.tests.ps1
Template.tests.ps1
# Pester testing. https://github.com/pester/Pester/wiki $myScript = "$PSScriptRoot\$fileName" Describe 'Unit Tests' { Context 'Basic Validation' { it 'Should run successfully' { if ($myScript -like '*ps1') { $run = invoke-expression $myScript } else { import-module $myScript $...
PowerShellCorpus/PowerShellGallery/vscodeextensions/0.1.2/EditorCommands.ps1
EditorCommands.ps1
# Example Editor Commands for Reference # Register-EditorCommand ` # -Name 'VSCodeExtensions.OpenEditorProfile' ` # -DisplayName 'Open Editor Profile' ` # -SuppressOutput ` # -ScriptBlock { # param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context) # If (!(Test-Path...