full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassificationProperty.config.ps1
BMD_cFSRMClassificationProperty.config.ps1
$classificationproperty = @{ Name = 'IntegrationTest' DisplayName = 'Integration Test' Type = 'SingleChoice' Ensure = 'Present' Description = 'Integration Test Property' PossibleValue = @( 'Value1', 'Value2', 'Value3' ) Parameters = @( 'Parameter1=Value1', 'Parameter2=Value2') } Configurati...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaTemplate.Integration.Tests.ps1
BMD_cFSRMQuotaTemplate.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMQuotaTemplate' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCRe...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMAutoQuota.Integration.Tests.ps1
BMD_cFSRMAutoQuota.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMAutoQuota' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCResour...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassification.config.ps1
BMD_cFSRMClassification.config.ps1
$classification = @{ Id = 'Default' Continuous = $False ContinuousLog = $False ContinuousLogSize = 2048 ExcludeNamespace = @('[AllVolumes]\$Extend /','[AllVolumes]\System Volume Information /s') ScheduleMonthly = @( 12,13 ) ScheduleRunDuration = 10 ...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileGroup.Integration.Tests.ps1
BMD_cFSRMFileGroup.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMFileGroup' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCResour...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMAutoQuota.config.ps1
BMD_cFSRMAutoQuota.config.ps1
$autoquota = @{ Path = $ENV:Temp Ensure = 'Present' Disabled = $false Template = (Get-FSRMQuotaTemplate | Select-Object -First 1).Name } Configuration BMD_cFSRMAutoQuota_Config { Import-DscResource -ModuleName cFSRM node localhost { cFSRMAutoQuota Integration_Test { Pat...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenTemplateAction.Integration.Tests.ps1
BMD_cFSRMFileScreenTemplateAction.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMFileScreenTemplateAction' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Mod...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaTemplateAction.Integration.Tests.ps1
BMD_cFSRMQuotaTemplateAction.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMQuotaTemplateAction' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module ....
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenAction.config.ps1
BMD_cFSRMFileScreenAction.config.ps1
$fileScreen = @{ Path = $ENV:Temp Description = 'Integration Test' Ensure = 'Present' Active = $false IncludeGroup = [System.Collections.ArrayList]@( 'Audio and Video Files','Executable Files','Backup Files' ) Template = (Get-FSRMFileScreenTemplate | Se...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMSettings.Integration.Tests.ps1
BMD_cFSRMSettings.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMSettings' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCResourc...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassificationProperty.Integration.Tests.ps1
BMD_cFSRMClassificationProperty.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMClassificationProperty' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Modul...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenException.Integration.Tests.ps1
BMD_cFSRMFileScreenException.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMFileScreenException' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module ....
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuota.config.ps1
BMD_cFSRMQuota.config.ps1
$quota = @{ Path = $ENV:Temp Description = 'Integration Test' Ensure = 'Present' Size = 5GB SoftLimit = $false ThresholdPercentages = [System.Collections.ArrayList]@( 100 ) Disabled = $false } Configuration BMD_cFSRMQuota_Config { Import-DscResource -ModuleName cFSRM node localhost ...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassificationRule.Tests.ps1
BMD_cFSRMClassificationRule.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMclassificationRule' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassificationPropertyValue.config.ps1
BMD_cFSRMClassificationPropertyValue.config.ps1
$classificationproperty = @{ Name = 'IntegrationTest' Type = 'SingleChoice' PossibleValue = @( 'Value1' ) } $classificationPropertyValue = @{ PropertyName = $classificationproperty.Name Name = $classificationproperty.PossibleValue[0] Description = 'Top Secret Description' } Configuration BMD_cF...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassification.Integration.Tests.ps1
BMD_cFSRMClassification.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMClassification' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCR...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenTemplate.config.ps1
BMD_cFSRMFileScreenTemplate.config.ps1
$fileScreenTemplate = @{ Name = 'IntegrationTest' Description = 'Integration Test' Ensure = 'Present' Active = $false IncludeGroup = [System.Collections.ArrayList]@( 'Audio and Video Files','Executable Files','Backup Files' ) } Configuration BMD_cFSRMFileScreenTe...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaTemplate.config.ps1
BMD_cFSRMQuotaTemplate.config.ps1
$quotaTemplate = @{ Name = 'IntegrationTest' Description = 'Integration Test' Ensure = 'Present' Size = 5GB SoftLimit = $false ThresholdPercentages = [System.Collections.ArrayList]@( 85, 100 ) } Configuration BMD_cFSRMQuotaTemplate_Config { Import-DscResource -ModuleName cFSRM node loca...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuota.Integration.Tests.ps1
BMD_cFSRMQuota.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMQuota' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCResource.T...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenTemplateAction.config.ps1
BMD_cFSRMFileScreenTemplateAction.config.ps1
$fileScreenTemplate = @{ Name = 'IntegrationTest' Description = 'Integration Test' Ensure = 'Present' Active = $false IncludeGroup = [System.Collections.ArrayList]@( 'Audio and Video Files','Executable Files','Backup Files' ) } $fileScreenTemplateAction = @{ T...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaTemplateAction.config.ps1
BMD_cFSRMQuotaTemplateAction.config.ps1
$quotaTemplate = @{ Name = 'IntegrationTest' Description = 'Integration Test' Ensure = 'Present' Size = 5GB SoftLimit = $false ThresholdPercentages = [System.Collections.ArrayList]@( 100 ) } $quotaAction = @{ Type = 'Email' Subject = '[FileScreen Threshold]% FileScreen threshold exceeded...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenException.config.ps1
BMD_cFSRMFileScreenException.config.ps1
$fileScreen = @{ Path = $ENV:Temp Description = 'Integration Test' Ensure = 'Present' Active = $false IncludeGroup = [System.Collections.ArrayList]@( 'Audio and Video Files','Executable Files','Backup Files' ) Template = (Get-FSRMFileScreenTemplate | Se...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenAction.Integration.Tests.ps1
BMD_cFSRMFileScreenAction.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMFileScreenAction' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DS...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaAction.config.ps1
BMD_cFSRMQuotaAction.config.ps1
$quota = @{ Path = $ENV:Temp Description = 'Integration Test' Ensure = 'Present' Size = 5GB SoftLimit = $false ThresholdPercentages = [System.Collections.ArrayList]@( 100 ) Disabled = $false } $quotaAction = @{ Type = 'Email' Subject = '[FileScreen Threshold]% FileScreen threshold ex...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMClassificationRule.config.ps1
BMD_cFSRMClassificationRule.config.ps1
$classificationProperty = @{ Name = 'IntegrationTest' Type = 'SingleChoice' PossibleValue = @( 'Value1' ) } $classificationRule = @{ Name = 'IntegrationTest' Description = 'Test Rule Description' ClassificationMechanism = 'Content Classifier' ContentRe...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreen.config.ps1
BMD_cFSRMFileScreen.config.ps1
$fileScreen = @{ Path = $ENV:Temp Description = 'Integration Test' Ensure = 'Present' Active = $false IncludeGroup = [System.Collections.ArrayList]@( 'Audio and Video Files','Executable Files','Backup Files' ) Template = (Get-FSRMFileScreenTemplate | Se...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileScreenTemplate.Integration.Tests.ps1
BMD_cFSRMFileScreenTemplate.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMFileScreenTemplate' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMFileGroup.config.ps1
BMD_cFSRMFileGroup.config.ps1
$filegroup = @{ Name = 'Test Group' Ensure = 'Present' Description = 'Test Description' IncludePattern = @('*.eps','*.pdf','*.xps') ExcludePattern = @('*.epsx') } Configuration BMD_cFSRMFileGroup_Config { Import-DscResource -ModuleName cFSRM node localhost { cFSRMFileGroup Integratio...
PowerShellCorpus/PowerShellGallery/cFSRM/2.0.1.48/Tests/Integration/BMD_cFSRMQuotaAction.Integration.Tests.ps1
BMD_cFSRMQuotaAction.Integration.Tests.ps1
$DSCModuleName = 'cFSRM' $DSCResourceName = 'BMD_cFSRMQuotaAction' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PlagueHO/DscResource.Tests.git') } Import-Module .\DSCReso...
PowerShellCorpus/PowerShellGallery/PesterMatchArray/0.2.2/RunPester.ps1
RunPester.ps1
function GetLineNumber($stackTrace){ if($stackTrace -match "at line: (\d*)"){ $matches[1]; } else { $null } } function GetFileName($stackTrace){ if($stackTrace -match "at line: (?:\d*) in (.*)\n"){ $matches[1]; } else { $null } } function FormatResult ($result){ process { $lineNumber =...
PowerShellCorpus/PowerShellGallery/PesterMatchArray/0.2.2/Publish.ps1
Publish.ps1
Param( [Parameter(Mandatory=$true)] [string]$powershellGalleryKey ) Publish-Module -NuGetApiKey $powershellGalleryKey -Path ./
PowerShellCorpus/PowerShellGallery/PesterMatchArray/0.2.2/Examples.ps1
Examples.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module "$here\PesterMatchArray.psm1" -Force Describe "MatchArrayOrdered examples" { It "single item arrays match" { ,@("a") | Should MatchArrayOrdered @("a") } It "arrays with the same contents match" { ,@("a", 1) | Should M...
PowerShellCorpus/PowerShellGallery/PesterMatchArray/0.2.2/PesterMatchArray.ps1
PesterMatchArray.ps1
function PesterMatchArrayUnordered($value, $expectedMatch) { $value = @($value) if($value.Length -ne $expectedMatch.Length){ return $false; } for($i=0; $i -lt $expectedMatch.Length; $i++){ if(-not($value -contains $expectedMatch[$i])){ return $false; } } ...
PowerShellCorpus/PowerShellGallery/PesterMatchArray/0.2.2/PesterMatchArray.Tests.ps1
PesterMatchArray.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" ## Test Assertion functions takenb from: https://github.com/pester/Pester/blob/ebfb0997365fea29f25b2aa3065378a3765eff4c/Functions/Assertions/Test-Assertion.ps1 fu...
PowerShellCorpus/PowerShellGallery/PsConfigHive/0.1.2/main/Get-CurrentHiveName.ps1
Get-CurrentHiveName.ps1
<# .SYNOPSIS Gets the Hive Name for the current scope .DESCRIPTION Gets the Hive Name for the current scope, this means that caller stack gets inspected in order to get the appropriate scope. This cmdlet uses Get-PSCallStack to understand the call hierarchy and determine the caller scope to use....
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Get-Font.ps1
Get-Font.ps1
function Get-Font { <# .Synopsis Gets the fonts available .Description Gets the fonts available on the current installation .Example Get-Font .Example Get-Font -IncludeDetail #> [OutputType([Windows.Media.FontFamily], [string])] pa...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Send-Printer.ps1
Send-Printer.ps1
function Send-Printer { <# .Synopsis Sends a image to the printer .Description #> [CmdletBinding(DefaultParameterSetName='FilePath')] param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName='FilePath')] [Al...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Show-Shape.ps1
Show-Shape.ps1
function Show-Shape { <# .Synopsis Shows shapes .Description Shows shapes .Example Show-Shape "Red" "Circle" #> [OutputType([IO.FileInfo], [byte[]])] param( # The type of shape [Parameter(Mandatory=$true,Position=1)] [ValidateSet("Circle",...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Save-FontPreview.ps1
Save-FontPreview.ps1
function Save-FontPreview { <# .Synopsis Saves font preview files .Description Saves font preview files to a directory, and makes a web page to display them .Example Get-Font | Sort-Object | Save-FontPreview .Link Get-Font #...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Format-Image.ps1
Format-Image.ps1
function Format-Image { <# .Synopsis Formats an image at various resolutions .Description Resizes an image into various resolutions and image formats. #> param( # The path to the image [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [Al...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Save-Screenshot.ps1
Save-Screenshot.ps1
function Save-Screenshot { <# .Synopsis Saves a screenshot of a UI element .Description Saves a screenshot of a WPF UI element to many different file formats .Example New-Button -FontFamily "Webdings" -Content ([char]0xcf) -FontSize 36 | Save-Screensh...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Get-Screenshot.ps1
Get-Screenshot.ps1
function Get-ScreenShot { <# .Synopsis Gets a screen capture .Description Captures the current screen .Example # Capture the whole screen Get-ScreenShot .Example # Capture the current window Get-ScreenShot -OfWindow .Example #...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Get-BusinessCard.ps1
Get-BusinessCard.ps1
function Get-BusinessCard { <# .Synopsis Gets a business card .Description Gets a business card design on demand. Select a font and card text, or put in important information and use an automatic layout. .Example # Raw Layout Get-BusinessCar...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Show-Logo.ps1
Show-Logo.ps1
function Show-Logo { <# .Synopsis Shows a simple text logo .Description Creates a logo out of any text, with a ton of options. .Example Show-Logo "A Logo" -FeelingLucky .Notes |HideParameterOnline Show, AsJob, AsType, InMemory, OutputUI, NoGuid, Row, Column, Row...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/RoughDraft.ezformat.ps1
RoughDraft.ezformat.ps1
$moduleRoot = "$home\documents\windowspowershell\modules\RoughDraft" Write-FormatView -TypeName System.Windows.Media.FontFamily -Action { if ($request -and $response) { $fileFound = Get-ChildItem -Path "$($_.Source).png" -ErrorAction SilentlyContinue if ($fileFound) { "<h3>$($_.S...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Switch-Color.ps1
Switch-Color.ps1
function Switch-Color { <# .Synopsis Switches a color up .Description Switches a color up by changing ratios of a given part or inverting the color .Example #> [CmdletBinding(DefaultParameterSetName='Shift')] param( # A color #|Color [ValidateScript({...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/ConvertTo-Icon.ps1
ConvertTo-Icon.ps1
function ConvertTo-Icon { <# .Synopsis Converts image to icons .Description Converts an image to an icon .Example ConvertTo-Icon -File .\Logo.png -OutputFile .\Favicon.ico #> [CmdletBinding()] param( # The file [Parameter(Mandatory=$true, Positio...
PowerShellCorpus/PowerShellGallery/RoughDraft/0.1/Get-Thumbnail.ps1
Get-Thumbnail.ps1
function Get-Thumbnail { <# .Synopsis Gets file thumbnails .Description Gets thumbnail images for a file .Example Get-ThumbNail .\a.jpg -SaveThumbnail #> param( # The path to the file [Parameter(Mandatory=$true, ValueFromPipeline=$true, ...
PowerShellCorpus/PowerShellGallery/Remoting/0.2.2.90/imports.ps1
imports.ps1
# grab functions from files get-childitem $psscriptroot\functions\ -filter "*.ps1" | ? { -not ($_.name.Contains(".Tests.")) } | ? { -not (($_.name).StartsWith("_")) } | % { . $_.fullname }
PowerShellCorpus/PowerShellGallery/Remoting/0.2.2.90/functions/Get-RemoteCert.ps1
Get-RemoteCert.ps1
function Get-RemoteCert { [cmdletbinding()] param ( [parameter(Mandatory=$true)][string]$computername, [parameter(Mandatory=$false)]$port = 443, $outfile, [switch][bool]$accept, $certstorelocation ) if ($port -in "powershell","rps","winrm") { $port = 5986 } write-host "connecting to $computername on port $port...
PowerShellCorpus/PowerShellGallery/Remoting/0.2.2.90/functions/Find-SessionMap.ps1
Find-SessionMap.ps1
function Find-SessionMap { [CmdletBinding()] param ([switch][bool] $reload = $true) if ($Global:psSessionsMap -eq $null -or $reload) { write-verbose "looking for sessionmap.ps1" $searchPAths = "$home\Documents\WindowsPowerShell\sessionmap.config.ps1","$home\Documents\sessionmap.config.ps1","$home\...
PowerShellCorpus/PowerShellGallery/Remoting/0.2.2.90/functions/New-RemoteSession.ps1
New-RemoteSession.ps1
function New-RemoteSession { [CmdletBinding()] param( [parameter(Mandatory=$true)] $ComputerName, [switch][bool] $NoSsl, [switch][bool] $Ssl, [switch][bool] $Reuse = $true, $ServerInfo = $null, [switch][bool] $ClearCredentials, $port, [switch][bool] $cim, [parameter(Mandatory=$false...
PowerShellCorpus/PowerShellGallery/OfficeOnlineServerDsc/1.0.0.0/Examples/FullExamples/NewFarm.ps1
NewFarm.ps1
<# .EXAMPLE This example shows how to install the prerequisites, binaries and set up a new farm on the local server. #> Configuration Example { param() Import-DscResource -ModuleName OfficeOnlineServerDsc $requiredFeatures = @( "Web-Server", ...
PowerShellCorpus/PowerShellGallery/OfficeOnlineServerDsc/1.0.0.0/Examples/Resources/OfficeOnlineServerFarm/1-NewFarm.ps1
1-NewFarm.ps1
<# .EXAMPLE This example shows how to create a basic web apps farm. There are many more options that can be configured on this resource, but this minimum configuration will deploy a farm that has editing enabled. #> Configuration Example { param() Import-DscResource -Mo...
PowerShellCorpus/PowerShellGallery/OfficeOnlineServerDsc/1.0.0.0/Examples/Resources/OfficeOnlineServerMachine/1-JoinFarm.ps1
1-JoinFarm.ps1
<# .EXAMPLE This example shows how to join a machine to an Office Web Apps farm. This shows that the new server will use all roles (it is not recommended to split roles out to dedicated servers for Office Online Server farms of less than 50 servers). #> Configuration Example { ...
PowerShellCorpus/PowerShellGallery/OfficeOnlineServerDsc/1.0.0.0/Examples/Resources/OfficeOnlineServerInstall/1-InstallBinaries.ps1
1-InstallBinaries.ps1
<# .EXAMPLE This example shows how to install the binaries for office online server to the local server. #> Configuration Example { param() Import-DscResource -ModuleName OfficeOnlineServerDsc OfficeOnlineServerInstall InstallBinaries { Ensure = "...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/scan/foreach-project.ps1
foreach-project.ps1
function Use-Projects { [CmdletBinding(DefaultParameterSetName="default",SupportsShouldProcess=$true)] param( [Parameter(ParameterSetName="scan")] [switch][bool] $scan, [Parameter(ParameterSetName="default")] [switch][bool] $all, [Parameter(ParameterSetName="default")] [switch][bool] $Allow...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/scan/scan-projects.ps1
scan-projects.ps1
import-module newtonsoft.json function Initialize-Projects { [CmdletBinding()] param ($Path = ".") $_path = $path ipmo pathutils $projectFiles = Get-Listing -Path $_path -files -include "*.csproj","*.xproj" -Recursive ` -Excludes "node_modules/","artifacts/","bin/","obj/",".hg/","dnx-packages/","package...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/scan/push-nugets.ps1
push-nugets.ps1
import-module newtonsoft.json function Push-Nugets { [CmdletBinding(SupportsShouldProcess=$true)] param( [switch][bool] $scan, [switch][bool] $all, [switch][bool] $AllowNoNuspec, [switch][bool] $force ) DynamicParam { $paramDictionary = new-object -Type System.Management.Automation.RuntimeDef...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/sln-verification.ps1
sln-verification.ps1
import-module pathutils import-module publishmap function get-slndependencies { [CmdletBinding(DefaultParameterSetName = "sln")] param( [Parameter(Mandatory=$true, ParameterSetName="sln",Position=0)][Sln]$sln, [Parameter(Mandatory=$true, ParameterSetName="slnfile",Position=0)][string]$slnfile...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/conversion.ps1
conversion.ps1
function get-referencesTo { [CmdletBinding(DefaultParameterSetName="sln")] param( [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0, ParameterSetName="sln")][Sln] $sln, [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0, ParameterSetName="csproj")][Csproj] $csproj...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/packagestoprojectjson.ps1
packagestoprojectjson.ps1
function Convert-PackagesToProjectJson { # Script to generate project.json for all packages.config file in the solution. # Run from root solution folder # execute this script with powershell: # powershell -File <filepath> # [-f <targetframework] net4 Param ( $Path = ".", [alias("f")] [string] $TargetFramework...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/packagesconfig-utils.ps1
packagesconfig-utils.ps1
function Copy-BindingRedirects { [CmdletBinding()] param($from = "app.config", $to = "app.orig.config") $fromXml = [xml](get-content $from) $toXml = [xml](get-content $to) $src = $fromxml.configuration.runtime.assemblyBinding $runtime = $toxml.SelectNodes('//configurati...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/sln-utils.ps1
sln-utils.ps1
$script:types = @" public class Sln { public string OriginalPath {get;set;} public string Path {get;set;} public string Fullname { get { return Path; }} public string[] Content {get;set;} public SlnProject[] projects {get;set;} public void Save() { System.IO.File.WriteAllLines(Full...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/csproj-utils.ps1
csproj-utils.ps1
$script:ns = 'http://schemas.microsoft.com/developer/msbuild/2003' $script:types = @" using System.Xml; public class Csproj { public System.Xml.XmlDocument Xml {get;set;} public string Path {get;set;} public string FullName { get { return Path; } } public string Name {get;set;} public string Guid {...
PowerShellCorpus/PowerShellGallery/csproj/1.0.23.304/functions/nuget-utils.ps1
nuget-utils.ps1
function get-shortName($package) { $m = $package -match "(?<shortname>.*?)(,(?<specificversion>.+)){0,1}$" return $Matches["shortname"] } <# this is duplicated from nupkg module #> function find-packagesdir { [CmdletBinding()] param ($path, [switch][bool]$all) if ($path -eq $null) { $p...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/APUtil.ps1
APUtil.ps1
$APAdapterParameters = @{ "Server" = "APPlusServer"; "Port" = "APPlusPort"; "WebServer" = "APPlusWebServer"; "WebPort" = "APPlusWebPort"; "WebSite" = "APPlusWebSite"; "WebServiceUrl" = "APPlusWebServiceUrl"; "WebServiceLogon" = "APPlusWebServiceLogOn"; "WebServicePassword" = "APP...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/ServiceUtil.ps1
ServiceUtil.ps1
# Determines if a Service exists with a name as defined in $ServiceName. # Returns a boolean $True or $False. Function Test-ServiceExists([string] $ServiceName) { [bool] $Return = $False if ( Get-CimInstance -ClassName Win32_Service -Filter "Name='$ServiceName'" ) { $Return = $True } Retu...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/RegistryUtil.ps1
RegistryUtil.ps1
function Uninstall-registryKey($Key) { msiexec /x $Key /quiet }
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/ContextUtil.ps1
ContextUtil.ps1
function Write-Context() { if (!$NavVersionCode) { Write-Warning "Context doesn't exist! It can't be written." return } $P1context = @{ NavVersionCode = $NavVersionCode NavVersion = $NavVersion NavInstance = $NavInstance NavDatabase = $NavDatabase ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/RESTUtil.ps1
RESTUtil.ps1
$RESTAdapterParameters = @{ "Server" = "Server"; "RESTPort" = "Port"; "AuthenticationMode" = "AuthenticationMode"; "SSL" = "SSL"; "Instance" = "InstanceName"; "ServiceAccountDomain" = "ServiceDomain"; "ServiceAccountLogin" = "ServiceLogin"; "ServiceAccountPassword" = "Unencrypted...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/FileUtil.ps1
FileUtil.ps1
# Unzip file function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item) } } function Get-PackageFolder($packageName) { $packageSrc = (Get-Package $package...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/test.ps1
test.ps1
<# Import-Module servermanager $featureNames = ('Web-Server', 'Web-Mgmt-Console', 'Web-Request-Monitor', 'Web-Windows-Auth', 'Web-Asp-Net45', 'Web-Net-Ext45', 'Web-ISAPI-Filter', 'Web-ISAPI-Ext', 'NET-WCF-HTTP-Activation45', 'NET-Framework-45-ASPNET') $features = Get-WindowsFeature $featureNames Write-Host "N...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/LinkUtil.ps1
LinkUtil.ps1
function Resolve-PathForced { <# .SYNOPSIS Calls Resolve-Path but works for files that don't exist. .REMARKS From http://devhawk.net/2010/01/21/fixing-powershells-busted-resolve-path-cmdlet/ #> param ( [string] $FileName ) $FileName = Resolve-Path $Fil...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/LogUtil.ps1
LogUtil.ps1
$LogLevels = ("ALL", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF") $logConfDir = "Logs\" $logConfFile = "loglevel" $log4NetFile = "Log4Net.config" function Test-LogLevel([string] $Level) { [bool]$found = $false foreach($logLevel in $LogLevels) { if ($Level -eq $logLevel) { ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/NavUtil.ps1
NavUtil.ps1
$NAVAdapterParameters = @{ "Server" = "Server"; "SOAPPort" = "Port"; "AuthenticationMode" = "AuthenticationMode"; "SSL" = "SSL"; "RTCPort" = "ClientPort" "Instance" = "InstanceName"; "ServiceAccountDomain" = "ServiceDomain"; "ServiceAccountLogin" = "ServiceLogin"; "ServiceAc...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/WebUtil.ps1
WebUtil.ps1
Function Get-FreeWebPort { <# .Synopsis Find a free port for web application. .Description Find a free port for web application, starting from a given port, and increment if needed. .Parameter startingPort The port to start with. .Example # find a free port starting...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/ApiKeyUtil.ps1
ApiKeyUtil.ps1
function Get-ApiPath { return "$env:ProgramData\$TenantPrefix\API\" } function Get-ApiFile { $baseDir = Get-ApiPath return $baseDir + "key" } function Get-ApiKey { $path = Get-ApiFile if (!(Test-Path $path)) { Write-Warning "No PlannerOne API key stored" Write-Warning "Store one with Set-P1Ap...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/OutputUtil.ps1
OutputUtil.ps1
function Write-Section($Text) { $baseColor = [Console]::ForegroundColor [Console]::ForegroundColor = "Cyan" Write-Output "$Text" [Console]::ForegroundColor = $baseColor } function Write-OK($Text) { $baseColor = [Console]::ForegroundColor [Console]::ForegroundColor = "Green" Write-Output "> $Text" [...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/ReportsUtil.ps1
ReportsUtil.ps1
$global:NameDelimiter = " " function Get-ConfigReportsFromTenant($Tenant) { return "$env:ProgramData\$TenantPrefix\$Tenant\Config\MigrationReports\" } function Get-GlobalReportPath() { return "$env:ProgramData\$TenantPrefix\MigrationReports\" } function Get-GlobalReportList() { $path = Get-Global...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/AdapterUtil.ps1
AdapterUtil.ps1
function Set-AdapterParameter([string] $Name, [string] $Value, $Parameters, $ParametersCollection, $ParametersTypeCollection, $CollectionName) { if (!($ParametersCollection.ContainsKey($Name))) { Write-Warning "Property $Name is not a valid property. Operation canceled." Write-ValidParameters $Co...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/DBUtil.ps1
DBUtil.ps1
function Get-LegacyDatabaseConfig($Role) { $path = Get-LegacyDBConfigPath $Role if (Test-Path $path) { [xml]$dbConfigReader = Get-Content $path $dbConfig = @{ Server = $dbConfigReader.DataConnectionConfig.serversList.Server.name; Database = $dbConfigReader.DataConne...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/MenuUtil.ps1
MenuUtil.ps1
function Show-Menu { param ( [Parameter(Mandatory=$true)] [string]$Title, [Parameter(Mandatory=$true)] [string[]]$Choices ) Write-Host "" Write-Host "===== $Title =====" Write-Host "" $number = 0 foreach ($choice in $Choices) { $number++ Write-Ho...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Private/TenantUtil.ps1
TenantUtil.ps1
$global:NameDelimiter = " " function Get-ServiceNameFromTenant($Tenant) { return $TenantPrefix + $Tenant } function Get-ServiceDisplayNameFromTenant($Tenant) { return $TenantPrefix + $NameDelimiter + $Tenant } function Get-ServicePath { return "$env:ProgramFiles\$TenantPrefix" } function ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Restore-P1ConfigVal.ps1
Restore-P1ConfigVal.ps1
function Restore-P1ConfigVal { <# .Synopsis Copy in local files the PlannerOne Config files. .Description After the backup command, this command copy the PlannerOne backup configuration files and reset the PlannerOne web security for the tenant(s). .Parameter filesDir Input ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Backup-P1ConfigValue.ps1
Backup-P1ConfigValue.ps1
function Backup-P1ConfigValue { <# .Synopsis Export PlannerOne configuration file to file. .Description Copy at destination path the PlannerOne configuration files to creat a backup folder. .Parameter OutDir The root directory path to use for export. .\p1EnvExport by default. ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Get-P1LogLevel.ps1
Get-P1LogLevel.ps1
function Get-P1LogLevel { <# .Synopsis Get the PlannerOne log level for tenant. .Description Get the PlannerOne log level for tenant. .Parameter Tenant The tenant name. #> [cmdletbinding()] param( [Parameter(Mandatory=$true)] [string] $Tenant ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Set-P1Tenant.ps1
Set-P1Tenant.ps1
function Set-P1Tenant { <# .Synopsis Modify a tenant configuration. .Description Modify the configuration of an existing PlannerOne tenant. .Parameter Tenant The tenant name. .Parameter WebServicePort The port to be used by AppServer for REST API. .Paramet...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Restore-P1WebSecurity.ps1
Restore-P1WebSecurity.ps1
function Restore-P1WebSecurity { <# .Synopsis Restore Web Application IIS configration based on security configuration (Authentication and SSL) .Description Configure IIS and register PlannerOne Web Application REST services with correct security configuration based on Authentication and SSL...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Copy-P1Environment.ps1
Copy-P1Environment.ps1
function Copy-P1Environment { <# .Synopsis Copy environments between two tenants .Description Copy all environments from one tenant to another. .Parameter InTenant The tenant name to copy from. .Parameter OutTenant The tenant name to copy to. #> [cmdletbind...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Start-P1WebManager.ps1
Start-P1WebManager.ps1
function Start-P1WebManager { <# .Synopsis Start PlannerOne web manager. .Description Start PlannerOne web manager in the default web browser. .Parameter Tenant The target tenant. .Example # Start PlannerOne web manager for tenant named Prod. Start-P1WebManager -...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Switch-P1Version.ps1
Switch-P1Version.ps1
function Switch-P1Version { <# .Synopsis Switch to another version an existing PlannerOne tenant (service + web app). .Description Switch an existing PlannerOne tenant to another version. Warning: PlannerOne service will be restarted during the process. .Parameter Tenant The...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Select-NAVInstance.ps1
Select-NAVInstance.ps1
function Select-NAVInstance { <# .Synopsis Detect existing NAV instances and allow to select the target. .Description Will look for all NAV instances and propose to the user to select the good one for PlannerOne integration. If there is only one instance, it will be selected automaticaly...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Initialize-NAVVersion.ps1
Initialize-NAVVersion.ps1
function Initialize-NAVVersion { <# .Synopsis Detect and initialize NAV Version on the local machine. .Description Will look for a NAV installation and will set some common variables in the session context. #> [cmdletbinding()] param ( ) Process { $Dynam...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Import-P1Environment.ps1
Import-P1Environment.ps1
function Import-P1Environment { <# .Synopsis Import PlannerOne environment from file. .Description Import an existing and initialized environment saved in file system. Each environments found for Production Scheduler and ResourcePlanner will be imported. .Parameter Tenant Th...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/New-P1ServerInstance.ps1
New-P1ServerInstance.ps1
function New-P1ServerInstance { <# .Synopsis Install a new PlannerOne service. .Description Install a new PlannerOne service with the given parameters. .Parameter Tenant The tenant name of this service. .Parameter ERP The adapter to use (NAV, AP, SAGE) .Example ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Set-P1AdapterParameter.ps1
Set-P1AdapterParameter.ps1
function Set-P1AdapterParameter { <# .Synopsis Set one parameter for the adapter. .Description Set an adapter parameter by name. Call Set-P1AdapterParameter with only the tenant name to get available parameters for it Some names are specific to some adapters. .Parameter Ten...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Import-P1NavTool.ps1
Import-P1NavTool.ps1
function Import-P1NavTool{ <# .Synopsis Import in local environnement the powershell module PlannerOne.NavTool. .Description Get the module from local package. .Parameter Version Dynamics NAV version. #><# param( [Parameter(Mandatory=$True)] [string] $Version ) $Mo...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Export-P1LegacyEnvironment.ps1
Export-P1LegacyEnvironment.ps1
function Export-P1LegacyEnvironment { <# .Synopsis Export legacy PlannerOne environment to file. .Description Export an existing and initialized legacy environment stored in a database and save it to file system. Each environments found for Production Scheduler and ResourcePlanner will ...
PowerShellCorpus/PowerShellGallery/PlannerOne.Deployment/1.0.151/Public/Get-P1WebSecurity.ps1
Get-P1WebSecurity.ps1
function Get-P1WebSecurity { <# .Synopsis Get the PlannerOne web security for tenant. .Description Get the PlannerOne web security for tenant. .Parameter Tenant The tenant name. #> [cmdletbinding()] param( [Parameter(Mandatory=$true)] [string] ...