full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwFolder/cf03-vCenter-Folder.ps1 | cf03-vCenter-Folder.ps1 | $tgtName = 'vEng.local.lab'
$vCenterName = 'vcsa.local.lab'
$configName = $tgtName.Split('.')[0]
enum Ensure {
Absent
Present
}
enum VmwFolderType {
Yellow
Blue
}
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-D... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwFolder/cf01-vCenter-Folder.ps1 | cf01-vCenter-Folder.ps1 | enum Ensure {
Absent
Present
}
$tgtName = 'vEng.local.lab'
$configName = 'Vmw'
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-DscResource -ModuleName vSphereDSC
Node $AllNodes.NodeName
{
$number = 0
... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwFolder/cf02-vCenter-Folder.ps1 | cf02-vCenter-Folder.ps1 | enum Ensure {
Absent
Present
}
$tgtName = 'vEng.local.lab'
$configName = 'Vmw'
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-DscResource -ModuleName vSphereDSC
Node $AllNodes.NodeName
{
$number = 0
... |
PowerShellCorpus/PowerShellGallery/AzureResourceSecurity/0.3.5/functions/Get-AzureRegion.ps1 | Get-AzureRegion.ps1 | <#
.SYNOPSIS
Returns the geo-political region of an Azure datacenter.
.DESCRIPTION
The Get-AzureRegion cmdlet returns the geo-political region of an Azure datacenter.
.EXAMPLE
C:\PS> Get-AzureRegion -location 'australiasoutheast'
.EXAMPLE
C:\PS> Get-AzureRegion -displayName 'Australia So... |
PowerShellCorpus/PowerShellGallery/AzureResourceSecurity/0.3.5/functions/Assert-SecureResourceGroupPolicyLocation.ps1 | Assert-SecureResourceGroupPolicyLocation.ps1 | <#
.SYNOPSIS
Applies an ARM policy on a Resource Group to prevent deployment of resources in other geo-political regions.
.DESCRIPTION
The Assert-SecureResourceGroupPolicyLocation cmdlet checks for the existence of an ARM policy which prevents deployment of resources outside the geopolitical region in w... |
PowerShellCorpus/PowerShellGallery/AzureResourceSecurity/0.3.5/functions/Assert-SecureResourceGroupRbac.ps1 | Assert-SecureResourceGroupRbac.ps1 | <#
.SYNOPSIS
Creates security groups in Azure Active Directory for selected Resource Groups and assigns Azure RBAC roles.
.DESCRIPTION
The Assert-SecureResourceGroupRbac cmdlet checks for the existence of a Security Group in Azure Active Directory for each RBAC role.
For example, a Resource Group... |
PowerShellCorpus/PowerShellGallery/AzureResourceSecurity/0.3.5/functions/Assert-SecureSubscriptionPolicyLocation.ps1 | Assert-SecureSubscriptionPolicyLocation.ps1 | <#
.SYNOPSIS
Applies an ARM policy on a Resource Group to prevent deployment of resources in other geo-political regions.
.DESCRIPTION
The Assert-SecureResourceGroupPolicyLocation cmdlet checks for the existence of an ARM policy which prevents deployment of resources outside the geopolitical region in w... |
PowerShellCorpus/PowerShellGallery/VMware.VimAutomation.Cloud/6.5.1.5375799/VMware.VimAutomation.Cloud.ps1 | VMware.VimAutomation.Cloud.ps1 | [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule(
"VMware.VimAutomation.Cloud.Commands",
(Split-Path $script:MyInvocation.MyCommand.Path));
function global:Get-CloudCommand([string] $Name = "*") {
get-command -Module VMware.VimAutomation.Cloud -Name $Name
}
set-al... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-ReferencedCommand.ps1 | Get-ReferencedCommand.ps1 | function Get-ReferencedCommand {
<#
.Synopsis
Gets the commands referred to from within a function or external script
.Description
Uses the Tokenizer to get the commands referred to from within a function or external script
.Example
Get-Command New-Button | Get-Refere... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Stop-PowerShellCommand.ps1 | Stop-PowerShellCommand.ps1 | function Stop-PowerShellCommand
{
<#
.Synopsis
Stops a PowerShell Command
.Description
Stops a PowerShell command that has been Registered with Register-PowerShellCommand
.Parameter name
The name of the command to stop
.Example
New-Grid -Rows 2 -Columns 2 -O... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Start-PowerShellCommand.ps1 | Start-PowerShellCommand.ps1 | function Start-PowerShellCommand
{
<#
.Synopsis
Starts a PowerShell Command
.Description
Starts a PowerShell command that has been Registered with Register-PowerShellCommand
.Parameter name
The name of the command to start
.Parameter interval
If set, will ru... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Invoke-Background.ps1 | Invoke-Background.ps1 | function Invoke-Background
{
[CmdletBinding(DefaultParameterSetName='ScriptBlock')]
param(
# A Script block to run in the background.
# To pass parameters to this script block, add a param() statement
[Parameter(Mandatory=$true,ParameterSetName='ScriptBlock',Position=0)]
[ScriptBlock]$Scr... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Write-Program.ps1 | Write-Program.ps1 | #requires -version 2.0
function Write-Program
{
<#
.Synopsis
Creates an application to run a PowerShell command.
.Description
Creates an application to run a PowerShell command.
The application will wrap any cmdlet and any function stored in a module and create a ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Set-UIValue.ps1 | Set-UIValue.ps1 | function Set-UIValue
{
param(
[Parameter(ValueFromPipeline=$true)]
[Windows.FrameworkElement]
$Ui,
[PSObject]
$Value,
[switch]
$passThru
)
begin {
Set-StrictMode -Off
function MaybeAddUIProperty {
param($ui)
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/ConvertTo-ISEAddOn.ps1 | ConvertTo-ISEAddOn.ps1 | function ConvertTo-ISEAddOn
{
[CmdletBinding(DefaultParameterSetName="CreateOnly")]
param(
[Parameter(Mandatory=$true,
ParameterSetName="DisplayNow")]
[string]$DisplayName,
[Parameter(Mandatory=$true,
ParameterSetName="CreateOnly")]
[Parameter(Mandatory=$true,
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Update-ControlOutput.ps1 | Update-ControlOutput.ps1 | function Update-ControlOutput
{
param(
[Parameter(ValueFromPipeline=$true)]
[Windows.FrameworkElement]
$Ui,
[PSObject]
$Value
)
begin {
Set-StrictMode -Off
function MaybeAddUIProperty {
param($ui)
if (-not $DoNotAdd... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Export-Application.ps1 | Export-Application.ps1 | function Export-Application
{
<#
.Synopsis
Exports a WPK script into an executable
.Description
Exports a WPK script into an executable.
Embeds all needed scripts within the executable, an
.Example
# Creates an .exe at the current path that runs digitalclock.ps1
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Unregister-PowerShellCommand.ps1 | Unregister-PowerShellCommand.ps1 | function Unregister-PowerShellCommand
{
<#
.Synopsis
Unregisters a PowerShell command registered to a Window
.Description
Unregisters a PowerShell command registered to a window, and stops and running instances of isolated commands
.Parameter name
The name of the comm... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-PowerShellOutput.ps1 | Get-PowerShellOutput.ps1 | function Get-PowerShellOutput
{
<#
.Synopsis
Gets the output from a PowerShell data source
.Description
Gets the output from a PowerShell data source
#>
[CmdletBinding(DefaultParameterSetName='TimeStampedOutput')]
param(
[String]
$Name,
$Vi... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-UICommand.ps1 | Get-UICommand.ps1 | function Get-UICommand {
[CmdletBinding(DefaultParameterSetName='CmdletSet')]
param(
[Parameter(ParameterSetName='AllCommandSet',
Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[System.String[... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-PowerShellDataSource.ps1 | Get-PowerShellDataSource.ps1 | function Get-PowerShellDataSource {
<#
.Synopsis
Gets a new PowerShell data source
.Description
Gets a new PowerShell data source.
PowerShell data sources are used within a WPF application or WPK script
to provide data from PowerShell to the UI asynchronously.
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/New-UIWidget.ps1 | New-UIWidget.ps1 | function New-UIWidget {
param(
[Parameter(Position=0,ValueFromPipeline=$true)]
[ScriptBlock]$Content,
[Alias("Refresh")]
[TimeSpan]$Interval = "0:0:2",
[ScriptBlock]$UpdateBlock = $([ScriptBlock]::Create("`$Window.Content = ( `n${Content}`n )")),
[Switch]$ShowI... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-PowerShellCommand.ps1 | Get-PowerShellCommand.ps1 | function Get-PowerShellCommand
{
param()
process {
[ShowUI.ShowUICommands]::BackgroundPowerShellCommand
}
}
|
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Register-PowerShellCommand.ps1 | Register-PowerShellCommand.ps1 | function Register-PowerShellCommand {
<#
.Synopsis
Registers a PowerShell scriptblock command for use within a window
.Description
Registers a PowerShell scriptblock for use within a window.
The command can be run registered for one time use,
it can register anonymous... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Get-UIValue.ps1 | Get-UIValue.ps1 | function Get-UIValue {
#.Synopsis
# Get the UIValue from a control
#.Description
# Returns the Tag, SelectedItems, or Text from a control, or collects it from the child controls.
[CmdletBinding(DefaultParameterSetName="Recurse")]
param(
# The UI FrameworkElement to get the value from
[Parameter(Valu... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Update-WPFJob.ps1 | Update-WPFJob.ps1 | function Update-WPFJob
{
<#
.Synopsis
Updates a running WPF Job by running a PowerShell script
.Description
Runs a PowerShell script within a WPF Job and returns the results.
This enables two way communication with WPF Jobs.
You can use the $Window variable and Get-Ch... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Start-WPFJob.ps1 | Start-WPFJob.ps1 | function Start-WPFJob
{
<#
.Synopsis
Starts a WPF Job to display a UI in the background
.Description
Starts a WPF Job to display a UI in the background.
You can stop the job with the Stop-Job cmdlet, or by closing the window.
You can run scripts within the window with... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/StyleSystem/Get-UIStyle.ps1 | Get-UIStyle.ps1 | function Get-UIStyle {
<#
.Synopsis
Get-UIStyle
.Description
.Example
#>
[CmdletBinding(DefaultParameterSetName='All')]
param (
[Parameter(ParameterSetName='Name',Mandatory=$true,Position=0)]
[string]
$Name = "default"
)
process {
i... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/StyleSystem/Import-UIStyle.ps1 | Import-UIStyle.ps1 | function Import-UIStyle
{
[CmdletBinding(DefaultParameterSetName='EasyName')]
param(
[Parameter(ParameterSetName='FileName',
Mandatory=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('Fullname')]
[string]
$FileName,
[Parameter(ParameterSetName='EasyName'... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/StyleSystem/Set-UIStyle.ps1 | Set-UIStyle.ps1 | function Set-UIStyle {
<#
.Synopsis
Set-UIStyle
.Description
Set-UIStyle will set the UI Style on a given control,
or will change the settings for a given style
.Example
$this | Set-UIStyle "Midnight"
.Example
Set-UIStyle "Midnight" @{
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/DigitalClock.ps1 | DigitalClock.ps1 | New-Label -FontSize 24 -On_Loaded {
Register-PowerShellCommand -scriptBlock {
$window.Content.Content = (Get-Date | Out-String).Trim()
} -run -in "0:0:0.5"
} -asjob
|
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/SimpleGradient.ps1 | SimpleGradient.ps1 | New-Canvas -Width 400 -Height 400 -Background {
New-LinearGradientBrush -SpreadMethod Pad -StartPoint "0,0" -EndPoint "1,1" {
New-GradientStop -Color "White" -Offset .1
New-GradientStop -Color "AliceBlue" -Offset .2
New-GradientStop -Color "Blue" -Offset .9
}
} -show
|
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/firstnamelastname.ps1 | firstnamelastname.ps1 | Import-Module ShowUI
function Out-LastNameFirstName
{
param($firstName,$lastName)
"$lastName, $firstName"
}
$in = New-UniformGrid -Columns 2 -ControlName Get-FirstAndLastName -Children {
'First Name'
New-TextBox -Name FirstName
'Last Name'
New-TextBox -Name LastName
'... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/ListBoxSamples.ps1 | ListBoxSamples.ps1 | New-ListBox {1..100 } -MaxHeight 300 -show
New-ListBox -SelectionMode Multiple {1..100 | Sort-Object -Descending} -MaxHeight 300 -show
New-ListBox {1..100} -On_KeyDown { if ($_.Key -eq "Enter") { $window.Close() } } -show |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/EllipseAnimation.ps1 | EllipseAnimation.ps1 | New-Window -Width 200 -Height 200 {
New-Ellipse -Fill Black -Width 200 -Height 100 -RenderTransform {
New-RotateTransform -CenterX 75 -CenterY 50
} -On_Loaded {
$da = New-DoubleAnimation -From 0 -To 360 -Duration ([Timespan]::FromMilliseconds(750)) -RepeatBehavior Forever
Start-Ani... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/SimpleUserInputAndSplatting.ps1 | SimpleUserInputAndSplatting.ps1 | $getCommandInput = UniformGrid -ControlName 'Get-InputForGetCommand' -Columns 2 {
"Command Name"
New-TextBox -Name Name
"Verb"
New-TextBox -Name Verb
"Noun"
New-TextBox -Name Noun
"In Module"
New-TextBox -Name Module
" " # Some Empty Space
New-Button "Get Command" -On... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/InvokeBackground.ps1 | InvokeBackground.ps1 | New-Grid -Columns 2 {
New-TextBlock -Margin 10 -TextWrapping Wrap -ZIndex 1 -HorizontalAlignment Left -FontWeight Bold -FontSize 12 -DataBinding @{
"Text" = "LastProgress.Activity"
}
New-TextBlock -Margin 10 -ZIndex 1 -TextWrapping Wrap -Column 1 -... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/ListView.ps1 | ListView.ps1 | New-ListView -Width 350 -Height 350 -DataBinding @{
ItemsSource = New-Binding -Path Output -IsAsync -UpdateSourceTrigger PropertyChanged
} -View {
New-GridView -AllowsColumnReorder -Columns {
New-GridViewColumn "Name"
New-GridViewColumn "Id"
}
} -DataContext {
Get-PowerShellDa... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/SkewAnimation.ps1 | SkewAnimation.ps1 | New-Window -Width 200 -Height 200 {
New-Rectangle -Fill Black -Width 200 -Height 100 -RenderTransform {
New-SkewTransform -AngleY 89
} -On_Loaded {
$da = New-DoubleAnimation -From 89 -To 0 -Duration ([Timespan]::FromMilliseconds(750)) -RepeatBehavior Forever
Start-Animation -InputOb... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/GetSimpleDetails.ps1 | GetSimpleDetails.ps1 | uniformgrid -ControlName "Get-FirstNameLastNameAndAge" -Columns 2 {
"Age"
textBox -Name "Age" 18
"First Name"
textBox -Name "FirstName" John
"Last Name"
textBox -Name "LastName" Smith
button -Content "Cancel" -IsCancel -On_Click {
Get-ParentControl |
Clo... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/DataTemplate.ps1 | DataTemplate.ps1 | New-ListBox -ItemsSource { Get-Process } -ItemTemplate {
New-StackPanel -Orientation Horizontal -Children {
New-Label -Name ProcessName -FontSize 14
New-Label -Name Id -FontSize 8
} | ConvertTo-DataTemplate -binding @{
"ProcessName.Content" = "ProcessName"
"Id.Content" = "... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/MoveControlExample.ps1 | MoveControlExample.ps1 | New-Grid -ControlName ToggleExample -Rows (@('Auto')*5) -Columns (@('Auto')*5) -On_Loaded {
foreach ($n in (1..25)) {
[int]$row = [Math]::Floor(($n -1)/ $this.RowDefinitions.Count)
[int]$column = ($n - 1)% $this.ColumnDefinitions.Count
New-ToggleButton $n -Row $row -Column $column -Widt... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/SelectEventLog.ps1 | SelectEventLog.ps1 | New-Grid -Rows (@('Auto') * 2) -Columns 2 -ControlName 'Get-EventLogInput' {
"After"
Select-Date -Column 1 -Name "After"
New-Button -Row 1 "Ok" -IsDefault -On_Click {
Get-ParentControl |
Set-UIValue -PassThru |
Close-Control
}
} -asjob |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/Stopwatch.ps1 | Stopwatch.ps1 | New-Grid -Rows 2 -Columns 2 -On_Loaded {
Register-PowerShellCommand -name UpdateClock -scriptBlock {
$stopWatch = Get-ChildControl StopWatch
$stopWatch.Content = [Datetime]::Now - $stopWatch.Tag
}
} {
New-Label -Name Stopwatch "0:0:0" -ColumnSpan 2
New-Button -... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/VideoPlayer.ps1 | VideoPlayer.ps1 | New-Window -AllowDrop -On_Drop {
$videoPlayer.Source = @($_.Data.GetFileDropList())[0]
$videoPlayer.Play()
} -On_Loaded {
$videoPlayer.Source = Get-ChildItem -Path "$env:Public\Videos\Sample Videos" -Filter *.wmv |
Get-Random | Select-Object -ExpandProperty Fullname
$videoPlayer.Play()
}... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/AddGridRowExample.ps1 | AddGridRowExample.ps1 | New-Window -Width 640 -Height 480 {
New-Grid -Rows 2 -Columns 2 -ShowGridLines {
New-Button -Row 0 -Column 0 -On_Click {
$addingRow = $true, $false | Get-Random
if ($addingRow) {
Add-GridRow $this.Parent -row 1 -index 0
} else {
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/Examples/ModuleExplorer.ps1 | ModuleExplorer.ps1 | New-Grid -Columns ('Auto', '1*') -Rows ('1*','Auto') -Resource @{
'Import-ModuleData' = {
$modules = @(Get-Module) + @(Get-Module -ListAvailable) |
Select-Object Name, Path, ExportedCommands -Unique |
Sort-Object Name
foreach ($m in $modules) {
New-TreeVie... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/Add-UIModule.ps1 | Add-UIModule.ps1 | function Add-UIModule {
#.Synopsis
# Generate a Module with commands for creating UI Elements
#.Description
# Generate a PowerShell Module from one or more assemblies (or types)
[CmdletBinding()]
param(
# The Path to an assembly to generate a UIModule for
[Parameter(Parameter... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/InstallShowUIAssembly.ps1 | InstallShowUIAssembly.ps1 | param(
$outputPathBase = "$psScriptRoot\GeneratedAssemblies\",
$CommandPath = "$outputPathBase\ShowUI.CLR$($psVersionTable.clrVersion).dll",
$CoreOutputPath = "$outputPathBase\ShowUICore.CLR$($psVersionTable.clrVersion).dll",
$Assemblies,
$Force,
$FileRoot = "$psScriptRoot"
)
# If the expected output... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/Add-CodeGenerationRule.ps1 | Add-CodeGenerationRule.ps1 | function Add-CodeGenerationRule
{
<#
.Synopsis
Adds a new rule for the code generation engine.
.Description
Adds a new rule for the code generation engine
.Parameter Type
The base type to apply the rule to. This type or any derivived types will apply the rule.
.Para... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/Get-AssemblyName.ps1 | Get-AssemblyName.ps1 | function Get-AssemblyName {
param(
$RequiredAssemblies,
[Type[]]$Types,
[String[]]$ExcludedAssemblies
)
$Assemblies = @($Types | Select-Object -ExpandProperty Assembly -Unique)
$ReferencedAssemblies = @(foreach($Asm in $Assemblies){ $asm.GetReferencedAssemblies() })
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/ConvertFrom-TypeToCmdlet.ps1 | ConvertFrom-TypeToCmdlet.ps1 | function ConvertFrom-TypeToScriptCmdlet
{
<#
.Synopsis
Converts .NET Types into Windows PowerShell Script Cmdlets
according to a number of rules. that have been added with Add-CodeGeneration rule
.Description
Converts .NET Types into Windows PowerShell Script Cmdlets
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/ConvertTo-ParameterMetaData.ps1 | ConvertTo-ParameterMetaData.ps1 | function ConvertTo-ParameterMetaData {
<#
.Synopsis
Turns reflection information on a type into parameter metadata
.Description
Turns reflection information on a type into parameter metadata.
Parameter metadata can be used to rapidly generate functions.
The s... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/Select-UIType.ps1 | Select-UIType.ps1 | function Select-UIType {
#.Synopsis
# Selects Types that are likely UI Elements or other types needed with ShowUI
[CmdletBinding()]
param(
[Parameter(Position=0, ValueFromPipelineByPropertyName=$true)]
[Alias('PSPath')]
[string[]]
$Path,
[Parameter()]
[Alias('AN')]
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CodeGenerator/Rules/WPFCodeGenerationRules.ps1 | WPFCodeGenerationRules.ps1 | # Editing this file is not recommended.
# This file contains a series of rules which will help convert the types WPF
# interacts with the most to Script Cmdlets in PowerShell. The rules are processed
# in the order that they appear
Add-CodeGenerationRule -Filter {
$_.Fullname -like "*Commands"
} -... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CommonControls/Select-ViaUI.ps1 | Select-ViaUI.ps1 | function Select-ViaUI {
#.Synopsis
# Select objects through a visual interface
#.Description
# Uses a graphical interface to select (and pass-through) pipeline objects
# Idea from Lee Holmes (http://www.leeholmes.com/blog)
#.Example
# Get-ChildItem | Select-ViaUI -show | Remove-Item -WhatIf
[OutputT... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CommonControls/Get-Input.ps1 | Get-Input.ps1 | function Get-Input
{
<#
.Synopsis
Collects user input
.Description
Get-Input collects a series of fields.
#>
param(
[Parameter(Mandatory=$true)]
[ValidateScript({
$in = $_
$badKeys =$in.Keys | Where-Object { $_ -isnot [string] }
if ($b... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CommonControls/Edit-StringList.ps1 | Edit-StringList.ps1 | function Edit-StringList
{
<#
.Synopsis
Edits a list of strings
.Description
Edits a list of strings.
#>
[OutputType([Windows.Controls.Grid], [string[]])]
param(
# Starting contents of a list
[string[]]$List,
# The name of the control
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CommonControls/Show-Clock.ps1 | Show-Clock.ps1 | function Show-Clock
{
<#
.Synopsis
Shows a clock.
.Description
Shows a clock, or counts down to a time and displays a message
.Example
Show-Clock -AsJob
.Example
$now = Get-Date
$christmas = $now.Subtract($now.TimeOfDay).AddD... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/CommonControls/Select-Date.ps1 | Select-Date.ps1 | function Select-Date
{
[OutputType([Windows.Controls.Border], [DateTime])]
param(
# The name of the control
[string]$Name,
# If the control is a child element of a Grid control (see New-Grid),
# then the Row parameter will be used to determine where to place the
# top of the ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-ControlPosition.ps1 | Get-ControlPosition.ps1 | function Get-ControlPosition {
<#
.Synopsis
Gets the screen position of the control
.Description
Retrieves the position of one or more UI Elements relative to another UI Element.
By default, the position is relative to the Window
.Example
New-Canvas -Width 600 -... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Hide-UIElement.ps1 | Hide-UIElement.ps1 | function Hide-UIElement
{
<#
.Synopsis
Hides a UI Element
.Description
Changes the Visibility property of one or more UI Elements to collapsed
.Parameter control
The UI Element to hide
.Parameter name
The name of the UI Element or elements to hide
.Exam... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-CommonParentControl.ps1 | Get-CommonParentControl.ps1 | function Get-CommonParentControl {
<#
.Synopsis
Gets the common parent control between two controls
.Description
Given two controls, Get-CommonParentControl will determine
what the common parent control is.
#>
param(
[Parameter(Mandatory=$true, ValueFromPipel... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Add-GridColumn.ps1 | Add-GridColumn.ps1 | function Add-GridColumn
{
<#
.Synopsis
Adds a column to an existing grid
.Description
Adds a column to an existing grid, and optionally offsets everything past a certain row
.Example
Add-GridColumn $grid -column Auto,Auto -index 2
.Paramet... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Enable-Multitouch.ps1 | Enable-Multitouch.ps1 | function Enable-MultiTouch
{
<#
.Synopsis
Enables multiple touch events on a window
.Description
Registers a window for multiple touch events and creates
three buffers (TouchStarts,TouchStops,TouchMoves) that
will contain all of the touch events that have occured with... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/ConvertTo-GridLength.ps1 | ConvertTo-GridLength.ps1 | function ConvertTo-GridLength
{
<#
.Synopsis
Turns $legnth into Windows.GirdLength objects
.Description
Turns the length parameter into GridLength objects.
.Parameter length
If the Length is just one integer, than that number of grid lengths will be created.
If t... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Copy-DependencyProperty.ps1 | Copy-DependencyProperty.ps1 | function Copy-DependencyProperty
{
<#
.Synopsis
Copies dependency properties from one object to another.
.Description
Reads the dependency properties from one object and writes
them to another. If a particular property could not be set,
then the error encountered wh... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Set-Property.ps1 | Set-Property.ps1 | function Set-Property
{
<#
.Synopsis
Sets properties on an object or subscribes to events
.Description
Set-Property is used by each parameter in the automatically generated
controls in ShowUI.
.Parameter InputObject
The object to set properties on
.Parameter... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Initialize-EventHandler.ps1 | Initialize-EventHandler.ps1 | function Initialize-EventHandler
{
param(
$resource = $(try { Get-Resource -ErrorAction SilentlyContinue } catch { Write-Debug "$_" }),
$parent = $(try { Get-ParentControl -ErrorAction SilentlyContinue } catch { Write-Debug "$_" })
)
if ($parent) {
$namedControls = ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-DependencyProperty.ps1 | Get-DependencyProperty.ps1 | function Get-DependencyProperty {
<#
.Synopsis
Gets the Dependency Properties that have been set on a control
.Description
Gets the Dependency Properties that have been set on a control.
.Example
New-Label "Hello World" -Row 1 | Get-DependencyProperty
#>
param(
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Write-WPFError.ps1 | Write-WPFError.ps1 | function Write-WPFError
{
param($err)
$thisTypeNAme = $this.GetType().Name
$thisName = $this.Name
if ($thisName) {
$errorLocation = "Error in $EventName Event Handler on $thisName ($thisTypeName) "
} else {
$errorLocation = "Error in $EventName Event Handler on $thisTyp... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Show-UIElement.ps1 | Show-UIElement.ps1 | function Show-UIElement
{
<#
.Synopsis
Shows a UI Element
.Description
Changes the Visibility property of one or more UI Elements to Visible
.Parameter control
The UI Element to show
.Parameter name
The name of the UI Element or elements to show
.Exa... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Out-Xaml.ps1 | Out-Xaml.ps1 | function Out-Xaml
{
param(
[Parameter(ValueFromPipeline=$true)]
$InputObject,
[switch]
[Alias('ShowQuickly')]
$Flash,
[switch]
$AsXml
)
process {
if ($Flash) {
New-Window -Top -10000 -Left -10000 -On_ContentRendered { ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Add-EventHandler.ps1 | Add-EventHandler.ps1 | function Add-EventHandler {
<#
.Synopsis
Adds an event handler to an object
.Description
Adds an event handler to an object. If the object has a
resource dictionary, it will add an eventhandlers
hashtable to that object and it will store the event handler,
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-ParentControl.ps1 | Get-ParentControl.ps1 | function Get-ParentControl
{
param(
[Parameter(ValueFromPipeline=$true, Mandatory=$false)]
[Alias('Tree')]
$Control = $this
)
process {
if (-not $Control) { return }
$parent = $control
while ($parent) {
if ($parent -is [Windows.Window... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Move-Control.ps1 | Move-Control.ps1 | function Move-Control {
<#
.Synopsis
Moves a control to a location, and animates the transition
.Description
Moves a control to a fixed point on the screen, to another control's location, or to the location and size of the parent control.
Also allows the control to be faded in ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Start-Animation.ps1 | Start-Animation.ps1 | function Start-Animation{
<#
.Synopsis
Starts animations on a property in any number of inputObjects
.Description
Starts animations on a property in any number of inputObjects
.Example
New-Window "Hello World" -SizeToContent WidthAndHeight -On_Loaded {
$this ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Test-Descendent.ps1 | Test-Descendent.ps1 | function Test-Descendent {
param(
[Parameter(Mandatory=$true)]
[Windows.UIElement]
$control,
[Parameter(Mandatory=$true)]
[Windows.UIElement]
$otherControl
)
$control.IsDescendentOf($otherControl)
}
|
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/ConvertTo-Xaml.ps1 | ConvertTo-Xaml.ps1 | function ConvertTo-Xaml
{
<#
.Synopsis
Attempts to coerce the text into XAML
.Description
Attempts to coerce the text into XAML
.Example
ConvertTo-Xaml "<Button Content='Click Me' />"
.Parameter text
The text to attempt to tr... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Add-GridRow.ps1 | Add-GridRow.ps1 | function Add-GridRow
{
<#
.Synopsis
Adds a row to an existing grid
.Description
Adds a row to an existing grid, and optionally offsets everything past a certain row
.Example
Add-GridRow $grid -row Auto,Auto -index 2
.Parameter grid
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Set-DependencyProperty.ps1 | Set-DependencyProperty.ps1 | function Set-DependencyProperty
{
<#
.Synopsis
Sets the dependency properties on an object.
.Description
Sets the dependency properties on an object.
Dependency properties are used in WPF to attach
auxilliary information to an object that other UI components
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Show-Window.ps1 | Show-Window.ps1 | function Show-Window {
<#
.Synopsis
Show-Window shows a WPF control within a window,
and is used by the -Show Parameter of all commands within WPK
.Description
Show-Window displays a control within a window and adds several resources to the window
to make several scen... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Set-Resource.ps1 | Set-Resource.ps1 | function Set-Resource
{
<#
.Synopsis
Sets a Resource that will be available across different handlers
for a control.
.Description
Writing user interfaces effectively is about sharing information
in between multiple controls. To do this, each control has a
d... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-ChildControl.ps1 | Get-ChildControl.ps1 | function Get-ChildControl
{
<#
.Synopsis
Imports variables to interact with a control's children
.Description
#>
param(
[Parameter(ValueFromPipeline=$true, Mandatory=$false)]
[Alias('Tree')]
$Control = $Window,
[Parameter(Position=0)][string[]]$ByName,
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Test-Ancestor.ps1 | Test-Ancestor.ps1 | function Test-Ancestor {
param(
[Parameter(Mandatory=$true)]
[Windows.UIElement]
$control,
[Parameter(Mandatory=$true)]
[Windows.UIElement]
$otherControl
)
$control.IsAncestorOf($otherControl)
}
|
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Remove-ChildControl.ps1 | Remove-ChildControl.ps1 | function Remove-ChildControl
{
<#
.Synopsis
Removes a Child from a parent control
.Description
Disconnects a child control from a parent control.
.Parameter Control
The control to remove
.Parameter Parent
The container the control is currently in.
#>
... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/ConvertTo-DataTemplate.ps1 | ConvertTo-DataTemplate.ps1 | function ConvertTo-DataTemplate
{
<#
.Synopsis
Converts the UIElement to a data template
.Description
Converts the UIElement to a data template by stripping its resources,
outputting the control as XAML, and enclosing within <DateTemplate> tags
.E... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Get-Resource.ps1 | Get-Resource.ps1 | function Get-Resource
{
<#
.Synopsis
Finds a Resource in a visual control or the controls parents
.Description
Retrieves a resource stored in the Resources property of a UIElement.
If the UIElement does not contain the resource, the parent will be checked.
If no more ... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Close-Control.ps1 | Close-Control.ps1 | function Close-Control
{
param(
[Parameter(ValueFromPipeline=$true)]
[Windows.Media.Visual]
$Visual = $this
)
process {
if (-not $visual) { return }
$parent = Get-ParentControl -Control $Visual
if ($parent) {
if ($parent -is [Windows.Window])... |
PowerShellCorpus/PowerShellGallery/ShowUI/1.5/WPF/Add-ChildControl.ps1 | Add-ChildControl.ps1 | function Add-ChildControl
{
<#
.Synopsis
Adds a Child Control to a panel
.Description
Adds a Child Control to a panel
.Example
New-StackPanel -On_Loaded {
New-Label "Hello" | Add-ChildControl -parent $this
}
.Parameter control
The UI El... |
PowerShellCorpus/PowerShellGallery/ServiceState/1.0.0.1/ServiceState.tests.ps1 | ServiceState.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/cIBMHTTPServer/1.1.2/Examples/Install-IHS.ps1 | Install-IHS.ps1 | #requires -Version 5
Configuration IHS
{
param (
[Parameter(Mandatory)]
[PSCredential] $KeyDBPassword,
[Parameter(Mandatory)]
[PSCredential] $CertPassword
)
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Import-DSCResource -ModuleName 'cIBMInsta... |
PowerShellCorpus/PowerShellGallery/PSMultiLog/2.0.0/Tests/PSMultiLog.tests.ps1 | PSMultiLog.tests.ps1 | $ParentPath = Split-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) -Parent
Import-Module -Name (Join-Path -Path $ParentPath -ChildPath "PSMultiLog.psm1")
#-------------------------------------------------------------------------------
# File Logging
#-----------------------------------... |
PowerShellCorpus/PowerShellGallery/FormatFunctions/1.0.7.1/Tests/FormatFunctions.Tests.ps1 | FormatFunctions.Tests.ps1 | #Pester Tests for FormatFunctions module
#the module to be tested is not in PSModulePath so explicitly import it
Import-Module ..\FormatFunctions
InModuleScope FormatFunctions {
Describe "Format-Percent" {
It "Should work with without error" {
{Format-Percent -Value 1 -Total 1 -Decim... |
PowerShellCorpus/PowerShellGallery/nServiceManager/0.2/Tests/nServiceHelper.ps1 | nServiceHelper.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
Import-Module "$here\..\nService.psm1" -Force
|
PowerShellCorpus/PowerShellGallery/nServiceManager/0.2/Tests/nServiceHelper.Tests.ps1 | nServiceHelper.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
$script:TestService = 'w3svc'
if ((Get-CimInstance win32_operatingsystem).ProductType -eq 1)
{
$script:TestService = 'HomeGroupListener'
}
Describe -Name 'n... |
PowerShellCorpus/PowerShellGallery/VsoReleaseManagerClient/2.0.3/Private/Read-VsoToken.ps1 | Read-VsoToken.ps1 | <############################################
Module : VsoReleaseManagerClient
Company : ItsZap Inc.
Author : Riwut Libinuko
Blog : http://blog.libinuko.com
Licence : GNU GENERAL PUBLIC LICENSE
Copyright © 2016, ItsZap Inc, Riwut Libinuko (cakriwut@gmail.com). All Rights Reserved
##... |
PowerShellCorpus/PowerShellGallery/VsoReleaseManagerClient/2.0.3/Private/Set-ConsolePosition.ps1 | Set-ConsolePosition.ps1 | <############################################
Module : VsoReleaseManagerClient
Company : ItsZap Inc.
Author : Riwut Libinuko
Blog : http://blog.libinuko.com
Licence : GNU GENERAL PUBLIC LICENSE
Copyright © 2016, ItsZap Inc, Riwut Libinuko (cakriwut@gmail.com). All Rights Reserved
##... |
PowerShellCorpus/PowerShellGallery/VsoReleaseManagerClient/2.0.3/Private/Get-VsoRelease.ps1 | Get-VsoRelease.ps1 | <############################################
Module : VsoReleaseManagerClient
Company : ItsZap Inc.
Author : Riwut Libinuko
Blog : http://blog.libinuko.com
Licence : GNU GENERAL PUBLIC LICENSE
Copyright © 2016, ItsZap Inc, Riwut Libinuko (cakriwut@gmail.com). All Rights Reserved
##... |
PowerShellCorpus/PowerShellGallery/VsoReleaseManagerClient/2.0.3/Private/Invoke-RestGet.ps1 | Invoke-RestGet.ps1 | <############################################
Module : VsoReleaseManagerClient
Company : ItsZap Inc.
Author : Riwut Libinuko
Blog : http://blog.libinuko.com
Licence : GNU GENERAL PUBLIC LICENSE
Copyright © 2016, ItsZap Inc, Riwut Libinuko (cakriwut@gmail.com). All Rights Reserved
##... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.