full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/PSColor/1.0.0.0/PSColorHelper.ps1
PSColorHelper.ps1
############################################################################## ## ## New-CommandWrapper ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## <# .SYNOPSIS Adds ...
PowerShellCorpus/PowerShellGallery/PSColor/1.0.0.0/FileInfo.ps1
FileInfo.ps1
# Helper method to write file length in a more human readable format function Write-FileLength { param ($length) if ($length -eq $null) { return "" } elseif ($length -ge 1GB) { return ($length / 1GB).ToString("F") + 'GB' } elseif ($length -ge 1MB) { ...
PowerShellCorpus/PowerShellGallery/PSColor/1.0.0.0/MatchInfo.ps1
MatchInfo.ps1
function MatchInfo { param ( [Parameter(Mandatory=$True,Position=1)] $match ) Write-host $match.RelativePath($pwd) -foregroundcolor $global:PSColor.Match.Path.Color -noNewLine Write-host ':' -foregroundcolor $global:PSColor.Match.Default.Color -noNewLine Write-host $match.Li...
PowerShellCorpus/PowerShellGallery/PSColor/1.0.0.0/ProcessInfo.ps1
ProcessInfo.ps1
function Write-Color-Process { param ([string]$color = "white", $file) Write-host ("{0,-7} {1,25} {2,10} {3}" -f $file.mode, ([String]::Format("{0,10} {1,8}", $file.LastWriteTime.ToString("d"), $file.LastWriteTime.ToString("t"))), (Write-FileLength $file.length), $file.name) -foregroundcolor $color } ...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/ErrorHandlingFunctions.ps1
ErrorHandlingFunctions.ps1
function RegisterException { if (![String]::IsNullOrWhiteSpace($systemLog)) { WriteLog -Path $systemLog -Message "ERROR: Error occurred" -RedirectStream $true Write-Warning "WARNING: For details examine '$systemLog'" *>&1 } else { Write-Warning "ERROR: Error occurr...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/CommonFunctions.ps1
CommonFunctions.ps1
function GetLastCreatedDir { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [string]$Directory ) if(!(Test-Path $Directory)) { return $null } $lastCreatedDir = Get-ChildItem -Path $Directory | Where-Object {$_.PSIsContainer} | Sort-Object Crea...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/SqlDatabasesFunctions.ps1
SqlDatabasesFunctions.ps1
function ImportSqlServerAssemblies { [CmdletBinding()] Param ( [string]$LogFile ) WriteLog -Path $LogFile -Message "Loading SQL Server assemblies" [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null WriteLog -Path $LogFile -Message "Micr...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/ValidationsFunctions.ps1
ValidationsFunctions.ps1
function ConfirmRemoteConnection { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $ComputerName ) $successConnecton = Test-Connection -ComputerName $ComputerName -Quiet return $successConnecton } function ConfirmSqlServerConnection {...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/WebsiteRootFunctions.ps1
WebsiteRootFunctions.ps1
function BackupWebsiteRoot { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateScript({ if (Test-Path $_) { $true } else { Throw "'$_' path is not valid. Please, provide a valid value" }})] [string]$SourceDir, [Parameter(Manda...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Private/LoggingFunctions.ps1
LoggingFunctions.ps1
function GetLogDir { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateScript({ if (Test-Path $_) { $true } else { Throw "'$_' path is not valid. Please, provide a valid value" }})] [string]$Directory ) $logsDirectory = Join-...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Restore-WebsiteRoot.ps1
Restore-WebsiteRoot.ps1
function Restore-WebsiteRoot { ############################################################################## #.SYNOPSIS # Restores website root files (used with Backup-WebsiteRoot) # #.DESCRIPTION # Use this function to maintain backups restore using Robocopy if deployment has failed # De...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Backup-SqlDatabasesRemotely.ps1
Backup-SqlDatabasesRemotely.ps1
function Backup-SqlDatabasesRemotely { ############################################################################## #.SYNOPSIS # Backs up SQL databases remotely (used with Restore-SqlDatabasesRemotely) # #.DESCRIPTION # Use this function to maintain backups of website SQL databases # Suppor...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Backup-SqlDatabases.ps1
Backup-SqlDatabases.ps1
function Backup-SqlDatabases { ############################################################################## #.SYNOPSIS # Backs up SQL databases (used with Restore-SqlDatabases) # #.DESCRIPTION # Use this function to maintain backups of website SQL databases # Supports all MS SQL Server vers...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Restore-SqlDatabasesRemotely.ps1
Restore-SqlDatabasesRemotely.ps1
function Restore-SqlDatabasesRemotely { ############################################################################## #.SYNOPSIS # Restores SQL databases remotely (used with Backup-SqlDatabasesRemotely) # #.DESCRIPTION # Use this function to maintain backups restore of website SQL databases ...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Backup-WebsiteRootRemotely.ps1
Backup-WebsiteRootRemotely.ps1
function Backup-WebsiteRootRemotely { ############################################################################## #.SYNOPSIS # Backs up website root files remotely (used with Restore-WebsiteRootRemotely) # #.DESCRIPTION # Use this function to maintain backups using Robocopy before starting t...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Restore-WebsiteRootRemotely.ps1
Restore-WebsiteRootRemotely.ps1
function Restore-WebsiteRootRemotely { ############################################################################## #.SYNOPSIS # Restores website root files remotely (used with Backup-WebsiteRootRemotely) # #.DESCRIPTION # Use this function to maintain backups restore using Robocopy if deploy...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Restore-SqlDatabases.ps1
Restore-SqlDatabases.ps1
function Restore-SqlDatabases { ############################################################################## #.SYNOPSIS # Restores SQL databases (used with Backup-SqlDatabases) # #.DESCRIPTION # Use this function to maintain backups restore of website SQL databases # Supports all MS SQL Ser...
PowerShellCorpus/PowerShellGallery/Sitecore.Deployment/0.7.0/Public/Backup-WebsiteRoot.ps1
Backup-WebsiteRoot.ps1
function Backup-WebsiteRoot { ############################################################################## #.SYNOPSIS # Backs up website root files (used with Restore-WebsiteRoot) # #.DESCRIPTION # Use this function to maintain backups using Robocopy before starting the deployment # Deta...
PowerShellCorpus/PowerShellGallery/e_powershell/16.4.28/e_powershell.ps1
e_powershell.ps1
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Private/Test-BTAudioPath.ps1
Test-BTAudioPath.ps1
function Test-BTAudioPath { param ( [Parameter(Mandatory)] [String] $Path ) $Extension = [IO.Path]::GetExtension($Path) $ValidExtensions = @( '.aac' '.flac' '.m4a' '.mp3' '.wav' '.wma' ) if ($Extension -in $ValidExtensions) { ...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTInput.ps1
New-BTInput.ps1
function New-BTInput { <# .SYNOPSIS Creates an input element on a Toast notification. .DESCRIPTION The New-BTInput function creates an input element on a Toast notification. Returned object is either a TextBox for users to type text into or SelectionBox to users to select f...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTAppId.ps1
New-BTAppId.ps1
function New-BTAppId { <# .SYNOPSIS Creates a new AppId Registry Key. .DESCRIPTION The New-BTAppId function create a new AppId registry key in the Current User's Registery Hive. If the desired AppId is already present in the Registry then no changes are made. If no AppId is...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTAudio.ps1
New-BTAudio.ps1
function New-BTAudio { <# .SYNOPSIS Creates a new Audio Element for Toast Notifications. .DESCRIPTION The New-BTAudioElement function creates a new Audio Element for Toast Notifications. You can use the parameters of New-BTAudioElement to select an audio file or a standard ...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTContextMenuItem.ps1
New-BTContextMenuItem.ps1
function New-BTContextMenuItem { <# .SYNOPSIS Creates a Context Menu Item object. .DESCRIPTION The New-BTContextMenuItem function creates a Context Menu Item object. .INPUTS None .OUTPUTS ToastContextMenuItem .EXAMPLE New-BTContextM...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/Submit-BTNotification.ps1
Submit-BTNotification.ps1
function Submit-BTNotification { <# .SYNOPSIS Submits a completed toast notification for display. .DESCRIPTION The Submit-BTNotification function submits a completed toast notification to the operating systems' notification manager for display. .INPUTS None ...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTVisual.ps1
New-BTVisual.ps1
function New-BTVisual { <# .SYNOPSIS Creates a new visual element for toast notifications. .DESCRIPTION The New-BTVisual function creates a new visual element for toast notifications, which defines all of the visual aspects of a toast. .INPUTS None .OUTPUTS...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTText.ps1
New-BTText.ps1
function New-BTText { <# .SYNOPSIS Creates a new Text Element for Toast Notifications. .DESCRIPTION The New-BTTextElement function creates a new Text Element for Toast Notifications. You can specify the text you want displayed in a Toast Notification as a string, or run the...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTBinding.ps1
New-BTBinding.ps1
function New-BTBinding { <# .SYNOPSIS Creates a new Generic Toast Binding object. .DESCRIPTION The New-BTBinding function creates a new Generic Toast Binding, where you provide text, images, and other visual elements for your Toast notification. .INPUTS None ...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BurntToastNotification.ps1
New-BurntToastNotification.ps1
function New-BurntToastNotification { <# .SYNOPSIS Creates and displays a Toast Notification. .DESCRIPTION The New-BurntToastNotification function creates and displays a Toast Notification on Microsoft Windows 10. You can specify the text and/or image displayed as well as s...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTHeader.ps1
New-BTHeader.ps1
function New-BTHeader { <# .SYNOPSIS Creates a new toast notification header. .DESCRIPTION The New-BTHeader function creates a new toast notification header for a Toast Notification. These headers are diaplyed at the top of a toast and are also used to categorize toasts in ...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTButton.ps1
New-BTButton.ps1
function New-BTButton { <# .SYNOPSIS Creates a new clickable button for a Toast Notification. .DESCRIPTION The New-BTButton function creates a new clickable button for a Toast Notification. Up to five buttons can be added to one Toast. Buttons can be fully customized with d...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTSelectionBoxItem.ps1
New-BTSelectionBoxItem.ps1
function New-BTSelectionBoxItem { <# .SYNOPSIS Creates a selection box item. .DESCRIPTION The New-BTSelectionBoxItem function creates a selection box item, for inclusion in a selection box created with New-BTInput. .INPUTS None .OUTPUTS ToastSelecti...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTImage.ps1
New-BTImage.ps1
function New-BTImage { <# .SYNOPSIS Creates a new Image Element for Toast Notifications. .DESCRIPTION The New-BTImageElement function creates a new Image Element for Toast Notifications. You can use the parameters of New-BTImageElement to specify the source image, alt text,...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTProgressBar.ps1
New-BTProgressBar.ps1
function New-BTProgressBar { <# .SYNOPSIS Creates a new Progress Bar Element for Toast Notifications. .DESCRIPTION The New-BTProgressBar function creates a new Progress Bar Element for Toast Notifications. You must specify the status and value for the progress bar and can o...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTAction.ps1
New-BTAction.ps1
function New-BTAction { <# .SYNOPSIS Creates an action object for a Toast Notification. .DESCRIPTION The New-BTAction function creates an 'action' object which contains defines the controls displayed at the bottom of a Toast Notification. Actions can either be system handel...
PowerShellCorpus/PowerShellGallery/BurntToast/0.6.0/Public/New-BTContent.ps1
New-BTContent.ps1
function New-BTContent { <# .SYNOPSIS Creates a new Toast Content object. .DESCRIPTION The New-BTContent function creates a new Toast Content object which is the Base Toast element, which contains at least a visual element. .INPUTS None .OUTPUTS Toa...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Private/New-DynamicParam.ps1
New-DynamicParam.ps1
Function New-DynamicParam { <# .SYNOPSIS Helper function to simplify creating dynamic parameters .DESCRIPTION Helper function to simplify creating dynamic parameters Example use cases: Include parameters only if your environment dictates it Include parameter...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Get-WLAvatar.ps1
Get-WLAvatar.ps1
function Get-WLAvatar { [CmdletBinding()] Param ( [Parameter()][string]$UserID ) Invoke-RestMethod -Uri ('a.wunderlist.com/api/v1/avatar?user_id={0}' -f $Id) -Headers $Script:headers -Method Get }
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/New-WLList.ps1
New-WLList.ps1
function New-WLList { [CmdletBinding()] Param ( [Parameter()][string]$Title ) $Parameters = @{ title = $Title } | ConvertTo-Json $List = Invoke-RestMethod -Uri ('{0}/lists' -f $Script:BaseUri) -Headers $Script:headers -Method Post -Body $Parameters -ContentType 'application/jso...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Get-WLUser.ps1
Get-WLUser.ps1
function Get-WLUser { [CmdletBinding()] Param ( [Parameter()][string]$Id ) Invoke-RestMethod -Uri 'a.wunderlist.com/api/v1/user' -Headers $Script:headers -Method Get }
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Get-WLTask.ps1
Get-WLTask.ps1
function Get-WLTask { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [PSTypeName('Wunderlist.List')] [System.Object[]] $InputObject, [Parameter()][long]$ListID, [Parameter()][switch]$Completed, [Parameter(...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Get-WLList.ps1
Get-WLList.ps1
function Get-WLList { [OutputType('Wunderlist.List')] [CmdletBinding()] Param ( [Parameter()][Int]$ListID ) begin { if ($PSBoundParameters.ContainsKey('ListID')) { $Query = ('{0}/lists/{1}' -f $Script:BaseUri, $PSBoundParameters['ListID']) } else { $Qu...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Set-WLAuthentication.ps1
Set-WLAuthentication.ps1
function Set-WLAuthentication { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)][string]$Client, [Parameter(Mandatory=$true)][string]$Token ) $Script:ClientID = $Client $Script:AccessToken = $Token $Script:headers = New-Object "System.Collections.Generic.Dictionary[[String...
PowerShellCorpus/PowerShellGallery/PSWunderlist/0.0.2/Public/Set-WLTask.ps1
Set-WLTask.ps1
function Set-WLTask { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [PSTypeName('Wunderlist.Task')] [System.Object[]] $InputObject, [Parameter()][long]$TaskID, [Parameter()][string]$Title, [Parameter()][b...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/ISEColorTheme.Cmdlets.Tests.ps1
ISEColorTheme.Cmdlets.Tests.ps1
$Here = Split-Path -Parent $MyInvocation.MyCommand.Path $PrivateFunctions = Get-ChildItem "$here\Private\" -Filter '*.ps1' -Recurse | Where-Object {$_.name -NotMatch "Tests.ps1"} $PublicFunctions = Get-ChildItem "$here\Public\" -Filter '*.ps1' -Recurse | Where-Object {$_.name -NotMatch "Tests.ps1"} $PrivateFunct...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Remove/Remove-ISETheme.ps1
Remove-ISETheme.ps1
function Remove-ISETheme { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] [cmdletbinding()] Param( [Parameter(ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [string]$ThemeName ) Begin{} Process { ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Remove/Remove-ISETheme.Tests.ps1
Remove-ISETheme.Tests.ps1
$function = Get-Command -Name Remove-ISETheme Describe 'Remove-ISETheme Tests' { Context 'Parameters for Remove-ISETheme'{ It 'Has a parameter called ThemeName' { $function.Parameters.Keys.Contains('ThemeName') | Should Be 'True' } It 'ThemeName Parameter is Correctly Identified...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Select/Select-ISETheme.ps1
Select-ISETheme.ps1
function Select-ISETheme { [cmdletbinding()] Param() #======================================================================== # Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.46 # Generated On: 3/18/2014 10:19 AM # Generated By: Jeff Pollock #====================...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Select/Select-ISETheme.Tests.ps1
Select-ISETheme.Tests.ps1
$function = Get-Command -Name Select-ISETheme Describe 'Select-ISETheme Tests' { }
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Set/Set-ISEColor.ps1
Set-ISEColor.ps1
function Set-ISEColor { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] [cmdletbinding()] Param( [Parameter(Mandatory=$True,ParameterSetName='Cooler',ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [switch]$Cooler, ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Set/Set-ISEColor.Tests.ps1
Set-ISEColor.Tests.ps1
$function = Get-Command -Name Set-ISEColor Describe 'Set-ISEColor Tests' { Context 'Parameters for Set-ISEColor'{ It 'Has a parameter called Cooler' { $function.Parameters.Keys.Contains('Cooler') | Should Be 'True' } It 'Cooler Parameter is Correctly Identified as being Mandator...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Set/Set-ISETheme.Tests.ps1
Set-ISETheme.Tests.ps1
$function = Get-Command -Name Set-ISETheme Describe 'Set-ISETheme Tests' { Context 'Parameters for Set-ISETheme'{ It 'Has a parameter called File' { $function.Parameters.Keys.Contains('File') | Should Be 'True' } It 'File Parameter is Correctly Identified as being Mandatory' { ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Set/Set-ISETheme.ps1
Set-ISETheme.ps1
function Set-ISETheme { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] [cmdletbinding()] Param( [Parameter(Mandatory=$True,ParameterSetName='FromFile',ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [string]$File, ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Export/Export-ISEThemeFile.ps1
Export-ISEThemeFile.ps1
function Export-ISEThemeFile { [cmdletbinding()] Param( [Parameter(ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [string]$ISETheme, [Parameter(ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [switch]$SaveToISE ) Begin{} ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Export/Export-ISEThemeFile.Tests.ps1
Export-ISEThemeFile.Tests.ps1
$function = Get-Command -Name Export-ISEThemeFile Describe 'Export-ISEThemeFile Tests' { Context 'Parameters for Export-ISEThemeFile'{ It 'Has a parameter called ISETheme' { $function.Parameters.Keys.Contains('ISETheme') | Should Be 'True' } It 'ISETheme Parameter is Correctly I...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Import/Import-ISEThemeFile.ps1
Import-ISEThemeFile.ps1
function Import-ISEThemeFile { [cmdletbinding()] Param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [object]$FileName, [Parameter()] [switch]$ApplyTheme ) Begin{} Process { # Get fullname if gci ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Import/Import-GroupISETheme.Tests.ps1
Import-GroupISETheme.Tests.ps1
$function = Get-Command -Name Import-GroupISEThemes Describe 'Import-GroupISEThemes Tests' { Context 'Parameters for Import-GroupISEThemes'{ It 'Has a parameter called Directory' { $function.Parameters.Keys.Contains('Directory') | Should Be 'True' } It 'Directory Parameter is Co...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Import/Import-GroupISETheme.ps1
Import-GroupISETheme.ps1
function Import-GroupISETheme { <# .Synopsis This is a function that Imports themes based on them being in ps1xml files stored in a directory that you give it .DESCRIPTION This is used internally by Add-ISETheme (so should be a Private Function) to Import ISE Theme files into the ISE .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Import/Import-ISEThemeFile.Tests.ps1
Import-ISEThemeFile.Tests.ps1
$function = Get-Command -Name Import-ISEThemeFile Describe 'Import-ISEThemeFile Tests' { Context 'Parameters for Import-ISEThemeFile'{ It 'Has a parameter called FileName' { $function.Parameters.Keys.Contains('FileName') | Should Be 'True' } It 'FileName Parameter is Correctly I...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-CurrentISETheme.ps1
Get-CurrentISETheme.ps1
function Get-CurrentISETheme { [CmdletBinding()] param() #-Create empty ISE Color object array $CurrentISEObjects = @() #-Get base colors $baseClass = @() $hash = @{Attribute = 'ErrorForegroundColor'; Hex = $psISE.Options.ErrorForegroundColor} $Obj...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-ImportedISETheme.ps1
Get-ImportedISETheme.ps1
function Get-ImportedISETheme { [CmdletBinding()] param() #-Get theme values from registry $Themes = Get-Item registry::HKey_Current_User\Software\Microsoft\PowerShell\3\Hosts\PowerShellISE\ColorThemes | Select-Object -ExpandProperty Property #-Get name and xml content and return it as an object ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-ISETheme.ps1
Get-ISETheme.ps1
function Get-ISETheme { [cmdletbinding()] Param( [Parameter(Mandatory=$True,ParameterSetName='fromfile',ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] [string]$File, [Parameter(Mandatory=$True,ParameterSetName='fromreg',ValueFromPipeline=$True,ValueFromPipelineb...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-CurrentISETheme.Tests.ps1
Get-CurrentISETheme.Tests.ps1
$function = Get-Command -Name Get-CurrentISETheme Describe 'Get-CurrentISETheme Tests' { }
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-ISETheme.Tests.ps1
Get-ISETheme.Tests.ps1
$function = Get-Command -Name Get-ISETheme Describe 'Get-ISETheme Tests' { Context 'Parameters for Get-ISETheme'{ It 'Has a parameter called File' { $function.Parameters.Keys.Contains('File') | Should Be 'True' } It 'File Parameter is Correctly Identified as being Mandatory' { ...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Get/Get-ImportedISETheme.Tests.ps1
Get-ImportedISETheme.Tests.ps1
$function = Get-Command -Name Get-ImportedISEThemes Describe 'Get-ImportedISEThemes Tests' { }
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Convert/Convert-HexToARGB.Tests.ps1
Convert-HexToARGB.Tests.ps1
$function = Get-Command -Name Convert-HexToARGB Describe 'Convert-HexToARGB Tests' { Context 'Parameters for Convert-HexToARGB'{ It 'Has a parameter called Hex_Val' { $function.Parameters.Keys.Contains('Hex_Val') | Should Be 'True' } It 'Hex_Val Parameter is Correctly Identified...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Convert/Convert-HexToARGB.ps1
Convert-HexToARGB.ps1
function Convert-HexToARGB { [cmdletbinding()] Param( [parameter(Mandatory=$True)] [string]$Hex_Val ) Begin{} Process { #-Convert values $A = [Convert]::ToInt32($Hex_Val.substring(1, 2), 16) $R = [Convert]::ToInt32($Hex_Val.substring(3, 2), 16)...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Convert/Convert-ARGBToHex.Tests.ps1
Convert-ARGBToHex.Tests.ps1
$function = Get-Command -Name Convert-ARGBToHex Describe 'Convert-ARGBToHex Tests' { Context 'Parameters for Convert-ARGBToHex'{ It 'Has a parameter called RGB_Val' { $function.Parameters.Keys.Contains('RGB_Val') | Should Be 'True' } It 'RGB_Val Parameter is Correctly Identified...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Convert/Convert-ARGBToHex.ps1
Convert-ARGBToHex.ps1
function Convert-ARGBToHex { [cmdletbinding()] Param( [parameter(Mandatory=$True)] [string]$RGB_Val ) Begin{} Process { #-separate the ARGB values $var_RGB = $RGB_Val.split(',') #-Convert values to Hex $var_A = [Convert]::ToStrin...
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Add/Add-ISEThemeMenu.Tests.ps1
Add-ISEThemeMenu.Tests.ps1
$function = Get-Command -Name Add-ISEThemeMenu Describe 'Add-ISEThemeMenu Tests' { }
PowerShellCorpus/PowerShellGallery/ISEColorTheme.Cmdlets/1.5/Public/Add/Add-ISEThemeMenu.ps1
Add-ISEThemeMenu.ps1
function Add-ISEThemeMenu { <# .Synopsis This is a function that adds more tooling to the ISE for switching themes .DESCRIPTION This is a function that adds more tooling to the ISE for switching themes making it easier to have a change when required .EXAMPLE Add-ISEThemeMenu #> [cmdlet...
PowerShellCorpus/PowerShellGallery/VMware.VimAutomation.Cis.Core/6.5.1.5374323/VMware.VimAutomation.Cis.Core.ps1
VMware.VimAutomation.Cis.Core.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.VimAutomation.Cis.Core.Commands", (Split-Path $script:MyInvocation.MyCommand.Path)); function global:Get-CisCommand([string] $Name = "*") { get-command -module VMware.VimAutomation.Cis.Core -Name $Name } # ...
PowerShellCorpus/PowerShellGallery/HPERedfishCmdlets/1.0.0.0/ShowLicense.ps1
ShowLicense.ps1
<# (c) Copyright 2015 Hewlett Packard Enterprise Development LP #> Add-Type @' public class AsyncPipeline { public System.Management.Automation.PowerShell Pipeline ; public System.IAsyncResult AsyncResult ; } '@ function Create-ThreadPool { [Cmdletbinding()] Param ( [Parameter(P...
PowerShellCorpus/PowerShellGallery/HPERedfishCmdlets/1.0.0.0/HPERedfishExamples.ps1
HPERedfishExamples.ps1
<# (c) Copyright 2016 Hewlett Packard Enterprise Development LP Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at     http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicabl...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Examples/DiscoverMovies.ps1
DiscoverMovies.ps1
# Purpose find movies based on options # Demonstrates using the options parameter # Find Movies with more than 1000 vote counts that are not animation in genres Find-TMDBMovie -options '{"vote_count.gte":"1000","without_genres":"16"}' -Verbose -OutVariable OverThousandVotes # Find Movies with more than 1000 vote...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Examples/SearchForMovie.ps1
SearchForMovie.ps1
# Purpose - Search for a movie by a string and return lots of information # about it from The Movie Database # [CmdletBinding()] param ( $Title ) $results = Search-TMDBMovie "$Title" $BestResult = $results.results[0] # Get movie information Get-TMDBMovieById -Id $BestResult.id # Get recommendati...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/TMDBClass.ps1
TMDBClass.ps1
# Create class for object that all TMDB calls will use. class MovieDB { [String]$ApiKey = "YOUR_APIKEY" [String]$BaseUri = "http://api.themoviedb.org/3/" [String]$ImagesUri = "http://image.tmdb.org/t/p/" [String] query() { return Write-Output -InputObject "?api_key=$($this.ApiKey)" ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/TVEndpoint.ps1
TVEndpoint.ps1
Function Get-TMDBtvShowById { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$False)] $options ) Begin { If(!$tmdb) ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/GenresEndpoint.ps1
GenresEndpoint.ps1
#region Genres endpoint Function Get-TMDBMovieGenres { [CmdletBinding()] param ( [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $options ) Begin { If(!$tmdb) { throw "Please run New-...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/TVSeasonsEndpoint.ps1
TVSeasonsEndpoint.ps1
Function Get-TMDBtvShowSeaonsById { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$True, ValueFromPipelinebyPropertyName=$true)] $SeasonNumber, ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/DiscoverEndpoint.ps1
DiscoverEndpoint.ps1
#region Discover endpoint Function Find-TMDBMovie { [CmdletBinding()] param ( [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $options ) Begin { If(!$tmdb) { throw "Please run New-akT...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/PeopleEndpoint.ps1
PeopleEndpoint.ps1
Function Get-TMDBPersonById { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$False)] $options ) Begin { If(!$tmdb) ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/TVEpisodesEndpoint.ps1
TVEpisodesEndpoint.ps1
Function Get-TMDBtvShowEpisodeById { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$True, ValueFromPipelinebyPropertyName=$true)] $SeasonNumber, [P...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/SearchEndpoint.ps1
SearchEndpoint.ps1
Function Search-TMDBMovie { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Filter, [Parameter(Mandatory=$False)] $options ) Begin{} Process { ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/NetworksEndpoint.ps1
NetworksEndpoint.ps1
Function Get-TMDBNetworks { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$False)] $options ) Begin { If(!$tmdb) ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/MoviesEndpoint.ps1
MoviesEndpoint.ps1
#region Movies endpoint Function Get-TMDBMovieById { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$False)] $options ) Begin { ...
PowerShellCorpus/PowerShellGallery/Posh-TMDB/1.2/Functions/ReviewsEndpoint.ps1
ReviewsEndpoint.ps1
Function Get-TMDBReview { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$true)] $Id, [Parameter(Mandatory=$False)] $options ) Begin { If(!$tmdb) ...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployWindowsPE.ps1
DeployWindowsPE.ps1
$Wimfile='C:\Pewim\custom.wim' $OSDrive='L' $WinPEDrive='C' $Disk $DriverPath='C:\Dell' $WinPETemp='C:\TempPE' $Disk=Get-AttachedDisk -USB -GUI $Env:WinPERoot="$($WinPEDrive)`:\Program Files$(Get-ArchitectureString)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment" $WinADK="$...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployWindowsVHDDomain.ps1
DeployWindowsVHDDomain.ps1
param( $SystemDrive='L', # Drive Letter being assigned to Windows Drive # $OSDrive='L', # Netbios name of computer and VMName # $Computername='Contoso-Win7' ) $VHD=Convert-WimtoVhd -Wimfile C:\Windows7\install.wim -vm $Computername $Mount=Mount-vhd $VHD Add-PartitionAccessPath -DiskId # Clear out the o...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerPhysicalMedia.ps1
DeployNanoServerPhysicalMedia.ps1
# New-NanoServerMedia $OSdrive='L' $WinPETemp='C:\TempPE' $Wimfile='C:\Pewim\custom.wim' $DriverPath='C:\Drivers' $NanoMedia='C:\' $WinPeDrive='C' #$Wimfile=New-WindowsPEWim $WimFile='C:\PeWim\Custom.wim' #$CustomNano=New-NanoServerWIM -Mediapath C:\ -Destination C:\NanoTemp -Compute $CustomNano='C:\NanoT...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployWindowsToGo.ps1
DeployWindowsToGo.ps1
$Wimfile='C:\Sources\Install.wim' $BootDrive='Y' $OSDrive='Z' $Disk=Get-AttachedDisk -GUI $DriverPath='C:\Drivers' New-PartitionStructure -Disk $disk -BootDrive $BootDrive -OSDrive $OsDrive Expand-WindowsImage –imagepath "$wimfile" –index 1 –ApplyPath "$OSDrive`:\" $Unattendfile='C:\Foo\Unattend.xml' $Con...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerVHDWorkgroup.ps1
DeployNanoServerVHDWorkgroup.ps1
param( # Size of the VHD file # $Size=20GB, # Location of the Nanoserver Wim created by # New-NanoServerWim # $Wimfile='C:\NanoTemp\NanoCustom.wim', # In the case of a single partition setup like # USB Key or simple VHD SystemDrive and OSDrive # Will be the same Letter # # Drive Letter being assigned to B...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerPhysical-UEFI.ps1
DeployNanoServerPhysical-UEFI.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $WinPEMedia, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)] ...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerPhysical-MBR.ps1
DeployNanoServerPhysical-MBR.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $WinPEMedia, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)] ...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerVHDDomain.ps1
DeployNanoServerVHDDomain.ps1
param( # Size of the VHD file # $Size=20GB, # Location of the Nanoserver Wim created by # New-NanoServerWim # $Wimfile='C:\NanoTemp\NanoCustom.wim', # In the case of a single partition setup like # USB Key or simple VHD SystemDrive and OSDrive # Will be the same Letter # # Drive Letter being assigned to B...
PowerShellCorpus/PowerShellGallery/DeployImage/1.21/DeployNanoServerPhysical.ps1
DeployNanoServerPhysical.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $WinPEMedia, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)] ...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFFeature/VE_SFFeature.ps1
VE_SFFeature.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( ## Path to Storefront installation executable [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] ...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFCluster/VE_SFCluster.ps1
VE_SFCluster.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [Parameter(Mandatory)] [System.String] $BaseUrl, [Parameter()] [System.UInt64] $SiteI...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFAuthenticationServiceMethod/VE_SFAuthenticationServiceMethod.ps1
VE_SFAuthenticationServiceMethod.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function ValidateParameters { [CmdletBinding()] param ( ## Citrix Storefront Authentication Service IIS Virtual Path [Parameter(Mandatory)] [System.String] $VirtualPath, ## Explicit authentic...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFStore/VE_SFStore.ps1
VE_SFStore.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [Parameter(Mandatory)] [System.String] $VirtualPath, ## Only applicable to v3.5 stores (if thi...