full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/DSCSQLBuildEncrypted.ps1
DSCSQLBuildEncrypted.ps1
#requires -Version 5 $StartTime = [System.Diagnostics.Stopwatch]::StartNew() $computers = 'OHSQL9012' $OutputPath = 'F:\DSCConfig' $KeyPath = 'F:\publicKeys' $cim = New-CimSession -ComputerName $computers Function check-even($num){[bool]!($num%2)} Function Get-Cert { Param ( [Sy...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/SQLPush_SingleServer.ps1
SQLPush_SingleServer.ps1
#requires -Version 5 $computers = 'OHSQL1016' $OutputPath = 'D:\DSCLocal' $cim = New-CimSession -ComputerName $computers #requires -Version 5 [DSCLocalConfigurationManager()] Configuration LCM_Push { Param( [string[]]$ComputerName ) Node $ComputerName { Settings ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/DSCClusterSqlBuild.ps1
DSCClusterSqlBuild.ps1
#requires -Version 5 $StartTime = [System.Diagnostics.Stopwatch]::StartNew() Function check-even($num){[bool]!($num%2)} $computers = 'OHSQL9013','OHSQL9014' $OutputPath = 'F:\DSCConfig' $cim = New-CimSession -ComputerName $computers [DSCLocalConfigurationManager()] Configuration LCM_Push { Para...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/xSQLServerEndpointPermission.ps1
xSQLServerEndpointPermission.ps1
$ConfigData = @{ AllNodes = @( @{ NodeName= "*" CertificateFile = "C:\Certificates\dsc-public.cer" Thumbprint = "D6F57B6BE46A7162138687FB74DBAA1D4EB1A59B" SqlInstanceName = "MSSQLSERVER" PSDscAllowDomainUser = $true }, ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/Resources/xSQLServerRole/2-RemoveServerRole.ps1
2-RemoveServerRole.ps1
<# .EXAMPLE This example shows how to ensure that the user account CONTOSO\SQLUser does not have "setupadmin" SQL server role. #> Configuration Example { param( [Parameter(Mandatory = $true)] [PSCredential] $SysAdminAccount ) ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Examples/Resources/xSQLServerRole/1-AddServerRole.ps1
1-AddServerRole.ps1
<# .EXAMPLE This example shows how to ensure that the user account CONTOSO\SQLAdmin has "dbcreator" and "securityadmin" SQL server roles. #> Configuration Example { param( [Parameter(Mandatory = $true)] [PSCredential] $SysAdminAccount ) ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerPermission.Tests.ps1
xSQLServerPermission.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'xSQLServerPermission' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCRes...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerDatabase.Tests.ps1
xSQLServerDatabase.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'MSFT_xSQLServerDatabase' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSC...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/unit_template.ps1
unit_template.ps1
<# .Synopsis Template for creating DSC Resource Unit Tests .DESCRIPTION To Use: 1. Copy to \Tests\Unit\ folder and rename <ResourceName>.tests.ps1 (e.g. MSFT_xFirewall.tests.ps1) 2. Customize TODO sections. .NOTES Code in HEADER and FOOTER regions are standard and may be moved into DSCResou...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/MSFT_xSQLServerScript.Test.ps1
MSFT_xSQLServerScript.Test.ps1
<# .SYNOPSIS Automated unit test for MSFT_xSQLServerScript DSC Resource #> $Script:DSCModuleName = 'MSFT_xSQLServerScript' $Script:DSCResourceName = 'MSFT_xSQLServerScript' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Pat...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/MSFT_xSqlAlias.Tests.ps1
MSFT_xSqlAlias.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'MSFT_xSqlAlias' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResourc...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerRole.Tests.ps1
xSQLServerRole.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'MSFT_xSQLServerRole' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCReso...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerAvailabilityGroupListener.Tests.ps1
xSQLServerAvailabilityGroupListener.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'xSQLServerAvailabilityGroupListener' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -Ch...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerEndpointState.Tests.ps1
xSQLServerEndpointState.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'xSQLServerEndPointState' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSC...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/MSFT_xSQLServerLogin.Tests.ps1
MSFT_xSQLServerLogin.Tests.ps1
# Suppressing this rule because PlainText is required for one of the functions used in this test [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param() $script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'MSFT_xSQLServerLogin' ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerReplication.Tests.ps1
xSQLServerReplication.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'xSQLServerReplication' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/MSFT_xSQLAOGroupEnsure.Tests.ps1
MSFT_xSQLAOGroupEnsure.Tests.ps1
# Suppressing this rule because PlainText is required for one of the functions used in this test [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () $script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'MSFT_xSQLAOGroupEnsure...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/xSQLServerEndpointPermission.Tests.ps1
xSQLServerEndpointPermission.Tests.ps1
$script:DSCModuleName = 'xSQLServer' $script:DSCResourceName = 'xSQLServerEndpointPermission' #region HEADER # Unit Test Template Version: 1.1.0 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Unit/Stubs/Write-ModuleStubFile.ps1
Write-ModuleStubFile.ps1
<# .SYNOPSIS Generates a file contaning function stubs of all cmdlets from the module given as a parameter. .PARAMETER ModuleName The name of the module to load and generate stubs from. This module must exist on the computer where this function is ran. .PARAMETER Path Pat...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Integration/integration_config_template.ps1
integration_config_template.ps1
<# .Synopsis DSC Configuration Template for DSC Resource Integration tests. .DESCRIPTION To Use: 1. Copy to \Tests\Integration\ folder and rename <ResourceName>.config.ps1 (e.g. MSFT_xFirewall.config.ps1) 2. Customize TODO sections. .NOTES #> # TODO: Modify ResourceName (e.g. MSFT_xFirewa...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xSQLServer/2.0.0.0/Tests/Integration/integration_template.ps1
integration_template.ps1
<# .Synopsis Template for creating DSC Resource Integration Tests .DESCRIPTION To Use: 1. Copy to \Tests\Integration\ folder and rename <ResourceName>.Integration.tests.ps1 (e.g. MSFT_xNeworking.Integration.tests.ps1) 2. Customize TODO sections. 3. Create test DSC Configurtion file <Resource...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xFailOverCluster/1.5.0.0/Tests/MSFT_xClusterNetwork.Tests.ps1
MSFT_xClusterNetwork.Tests.ps1
[CmdletBinding()] param ( ) if (!$PSScriptRoot) { $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) } $RootPath = (Resolve-Path -Path "$PSScriptRoot\..").Path $ModuleName = 'MSFT_xClusterNetwork' try { if (-not (Get-WindowsFeature -Name RSAT-Clustering-PowerS...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xFailOverCluster/1.5.0.0/Tests/MSFT_xClusterQuorum.Tests.ps1
MSFT_xClusterQuorum.Tests.ps1
[CmdletBinding()] param ( ) if (!$PSScriptRoot) { $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) } $RootPath = (Resolve-Path -Path "$PSScriptRoot\..").Path $ModuleName = 'MSFT_xClusterQuorum' try { if (-not (Get-WindowsFeature -Name RSAT-Clustering-PowerShel...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xFailOverCluster/1.5.0.0/Tests/MSFT_xCluster.Tests.ps1
MSFT_xCluster.Tests.ps1
[CmdletBinding()] param ( ) if (!$PSScriptRoot) { $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) } $RootPath = (Resolve-Path -Path "$PSScriptRoot\..").Path $ModuleName = 'MSFT_xCluster' Add-WindowsFeature -Name RSAT-Clustering-PowerShell -ErrorAction SilentlyConti...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xFailOverCluster/1.5.0.0/Tests/MSFT_xClusterPreferredOwner.Tests.ps1
MSFT_xClusterPreferredOwner.Tests.ps1
[CmdletBinding()] param ( ) if (!$PSScriptRoot) { $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) } $RootPath = (Resolve-Path -Path "$PSScriptRoot\..").Path $ModuleName = 'MSFT_xClusterPreferredOwner' try { if (-not (Get-WindowsFeature -Name RSAT-Clustering...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/DSCResources/xFailOverCluster/1.5.0.0/Tests/MSFT_xClusterDisk.Tests.ps1
MSFT_xClusterDisk.Tests.ps1
[CmdletBinding()] param ( ) if (!$PSScriptRoot) { $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) } $RootPath = (Resolve-Path -Path "$PSScriptRoot\..").Path $ModuleName = 'MSFT_xClusterDisk' Add-WindowsFeature -Name RSAT-Clustering-PowerShell -ErrorAction Silentl...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Examples/Main.ps1
Main.ps1
#Requires -RunAsAdministrator $LabConfig = 'D:\LabInaBox\Examples\DemoConfig.json' #Import-Module -name D:\LabInaBox\modules\LabinaBox.psm1 New-LabinaBox -configuration $LabConfig Stop-LabinaBox -configuration $LabConfig Start-LabinaBox -configuration $LabConfig CheckPoint-LabinaBox -configuration $LabConfig ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabGuestAddtoDomainDSCConfig.ps1
LabGuestAddtoDomainDSCConfig.ps1
Param ( [Parameter(Mandatory)][string]$machineName, [PSCustomObject] $configuration ) [DSCLocalConfigurationManager()] Configuration LCM_Push { Param( [string[]]$ComputerName ) Node $ComputerName { Settings { AllowModuleOverwrite = $True ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabGuestPostDomainConfig.ps1
LabGuestPostDomainConfig.ps1
Param ( [Parameter(Mandatory)][string]$machineName, [PSCustomObject] $configuration, [Parameter(Mandatory)][pscredential]$domainCred ) [DSCLocalConfigurationManager()] Configuration LCM_Push { Param( [string[]]$ComputerName ) Node $ComputerName { Settings ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabHostCreateVMConfig.ps1
LabHostCreateVMConfig.ps1
param( [Parameter(Mandatory)] [string]$VMName, [Parameter(Mandatory)] [string]$SysPrepImage, [PSCustomObject] $configuration ) Configuration HyperV_CreateVM { param([Parameter(Mandatory)] [string]$VMName, [Parameter(Mandatory)] ...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabGuestPreDomainConfig.ps1
LabGuestPreDomainConfig.ps1
Param ( [Parameter(Mandatory)][string]$machineName, [PSCustomObject] $configuration, [Parameter(Mandatory)][pscredential]$domainCred, [Parameter(Mandatory)][pscredential]$safemodeCred ) [DSCLocalConfigurationManager()] Configuration LCM_Push { Param( [string[]]$ComputerName...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabHostResourcesConfig.ps1
LabHostResourcesConfig.ps1
param( [PSCustomObject] $configuration ) #Ensure all the Directories and Resources required to configure the Host are present Configuration ResourceSetup { param( [PSCustomObject] $configuration ) Import-DscResource –ModuleName PSDesiredSt...
PowerShellCorpus/PowerShellGallery/LabinaBox/1.0/Scripts/Configuration/LabHostHyperVFeatureConfig.ps1
LabHostHyperVFeatureConfig.ps1
[DSCLocalConfigurationManager()] Configuration LCM_Push { Param( [string[]]$ComputerName ) Node $ComputerName { Settings { AllowModuleOverwrite = $True ConfigurationMode = 'ApplyOnly' ActionAfterReboot = 'ContinueConfiguration' ...
PowerShellCorpus/PowerShellGallery/PoshBot/0.4.1/PoshBotAttribute.ps1
PoshBotAttribute.ps1
# Out custom attribute that external modules can decorate # command with. This controls the command behavior when imported # https://msdn.microsoft.com/en-us/library/84c42s56(v=vs.110).aspx Add-Type -TypeDefinition @" namespace PoshBot { public enum TriggerType { Command, Event, ...
PowerShellCorpus/PowerShellGallery/PoshBot/0.4.1/Task/StartPoshBot.ps1
StartPoshBot.ps1
#requires -modules PoshBot [cmdletbinding()] param( [parameter(Mandatory)] [ValidateScript({ if (Test-Path -Path $_) { if ( (Get-Item -Path $_).Extension -eq '.psd1') { $true } else { Throw 'Path must be to a valid .psd1 file' ...
PowerShellCorpus/PowerShellGallery/ColoredText/1.0.5/Tests/ColoredText.Test.ps1
ColoredText.Test.ps1
using module ColoredText foreach ($color in [Enum]::GetNames([ConsoleColor])) { cprint ('{0,-12}' -f $color) black on $color lpad print cr } [ColoredText]$text = "Hello World" [Void]$text.cr().lpad().rpad().black().on().darkblue().print(). text('More Text').black().on().darkyellow().print().reset(). text('Speci...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/Invoke.ps1
Invoke.ps1
#<# # This script expects to be passed a psobject with all the needed properties # in order to invoke a 'VirtualMachine' DSC resource. ##> #param( # $Options, # [bool]$Direct = $true #) #$type = $Options.Resource.split(':')[1] #switch ($type) { # 'vm' { # $provJson = '' # if ($null -ne $O...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Invoke.ps1
Invoke.ps1
<# This script expects to be passed a psobject with all the needed properties in order to invoke a 'VirtualMachine' DSC resource. #> [cmdletbinding()] param( [parameter(mandatory)] [psobject]$Options, [bool]$Direct = $false ) # Ensure we have a valid 'ensure' property if ($null -eq $Options.option...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Powershell/Test.ps1
Test.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Powershell script provisioner test: beginning' } process { $scriptPath = $Options.ProvOptions.Path if (($scriptPath.StartsWith('http://')) -or ($scriptPath.StartsWith('https://'))) { $filename = $...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Powershell/Deprovision.ps1
Deprovision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Powershell script deprovisioner: beginning' } process { $scriptPath = $Options.ProvOptions.Path if (($scriptPath.StartsWith('http://')) -or ($scriptPath.StartsWith('https://'))) { $filename = $scr...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Powershell/Provision.ps1
Provision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Powershell script provisioner: beginning' } process { $scriptPath = $Options.ProvOptions.Path if (($scriptPath.StartsWith('http://')) -or ($scriptPath.StartsWith('https://'))) { $filename = $scrip...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/DomainJoin/Test.ps1
Test.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'DomainJoin provisioner test: beginning' } process { #Write-Verbose -Message 'Testing DomainJoin provisioner...' $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $djOptions = $provOptions...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/DomainJoin/Deprovision.ps1
Deprovision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'DomainJoin deprovisioner: beginning' } process { Write-Verbose -Message 'Running DomainJoin deprovisioner...' $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $djOptions = $provOptions | ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/DomainJoin/Provision.ps1
Provision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'DomainJoin provisioner: beginning' } process { Write-Verbose -Message 'Running DomainJoin provisioner...' $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $djOptions = $provOptions | Wher...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/Test.ps1
Test.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Chef provisioner test: beginning' } process { # Test to see if the Chef client is already installed $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $chefOptions = ($provOptions | Where-...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/Deprovision.ps1
Deprovision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Chef deprovisioner: beginning' } process { try { Write-Verbose -Message 'Deleting node from Chef...' $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $chefOptions = ($prov...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/Provision.ps1
Provision.ps1
[cmdletbinding()] param( [parameter(mandatory)] $Options ) begin { Write-Debug -Message 'Chef provisioner: beginning' } process { try { Write-Verbose -Message 'Configuring Chef client...' $provOptions = ConvertFrom-Json -InputObject $Options.Provisioners $chefOptions = ($provOp...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_InvokeChefQuery.ps1
_InvokeChefQuery.ps1
<# .SYNOPSIS Run the desired query against chef and pass back an object #> [CmdletBinding()] param ( [parameter(Mandatory)] [string]$OrgUri, [alias("path")] # Path that is being requested from the chef server $uri, [ValidateSet('GET', 'PUT', 'POST', 'DELETE')] [string] # Method to be u...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_InvokeChefRestMethod.ps1
_InvokeChefRestMethod.ps1
[CmdletBinding()] param ( [string] # The URI of the end point that needs to used $uri, [hashtable] # Hash of headers that need to be added to the request $headers = @{}, [string] # The accept string. $accept = "application/json", [ValidateSet('GET', 'PUT', 'POST', 'DELETE')] ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_InitializeBouncyCastle.ps1
_InitializeBouncyCastle.ps1
# Load the Bouncycastle library without locking the DLL or needlessly re-loading try { $assemblyLoaded = New-Object Org.BouncyCastle.Crypto.Engines.RsaEngine -ErrorAction SilentlyContinue } catch { $dll = Join-Path -Path $PSScriptRoot -ChildPath 'BouncyCastle.Crypto.dll' if ( !(Test-Path $dll) ) { t...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_SetHeaders.ps1
_SetHeaders.ps1
<# .SYNOPSIS Build up the headers that are required for a chef API query .DESCRIPTION Function to build up the headers for the query against the chef server. It will also build up the hash that is required for the body and then sign it #> param ( [string] $path, [string] $method = "GET", $data, ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_GetBase64.ps1
_GetBase64.ps1
param ( $data ) # if the $data is a string then ensure it is a byte array if ($data.GetType().Name -eq "String") { $data = [System.Text.Encoding]::UTF8.GetBytes($data) } # Return the base64 representation of the string [System.Convert]::ToBase64String($data)
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_GetKeyPairFromPem.ps1
_GetKeyPairFromPem.ps1
<# .SYNOPSIS Creates a key object based on PEM data passed to the function .DESCRIPTION BouncyCastle encryption does not read in a PEM file directly, it has to be imported so that it is converted to an object. This function checks to see if the PEM that has been passed is actually a string repres...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_InvokeEncrypt.ps1
_InvokeEncrypt.ps1
[CmdletBinding()] param ( # String to encrypt $data, [alias('pemPath')] # the item in the config to use to sign the data $pem, [switch] # The default way to encrypt with RSA is to use the public key # By setting this switch the private key will be used instead $private ) & "$PSScr...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Provisioners/Chef/helpers/_GetChecksum.ps1
_GetChecksum.ps1
<# .SYNOPSIS Return the checksum of the specified file #> param ( [Parameter(ParameterSetName="file")] [string] # Path to the file to get the checksum for $path, [Parameter(ParameterSetName="string")] [string] # The string to get the checksum for $string, [ValidateSet("sha1...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetConfigDiskToVMDiskMapping.ps1
_GetConfigDiskToVMDiskMapping.ps1
function _GeConfigDiskToVMDiskMapping { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DiskSpec ) try { $vmView = $vm | Get-View -Verbose:$false -Debug:$false ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetTags.ps1
_SetTags.ps1
function _SetTags { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNull()] [string]$Tags ) $desiredTags = $Tags | ConvertFrom-Json $tagAssignments = $vm | Get-TagAssignment -Verbose:$fa...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestGuestDisks.ps1
_TestGuestDisks.ps1
function _TestGuestDisks { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DiskSpec, [Parameter(Mandatory)] [pscredential]$Credential ) begin { W...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_RequestInfoBloxIP.ps1
_RequestInfoBloxIP.ps1
function _RequestInfoBloxIP { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Network, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetGuestVMIPAddress.ps1
_GetGuestVMIPAddress.ps1
function _GetGuestVMIPAddress{ [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $VM ) # Get the VM again to ensure we have the latest information about it # because the IP address will only get populated once VMware Tools is running $t = Get-VM -Id $VM...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMPowerState.ps1
_SetVMPowerState.ps1
function _SetVMPowerState { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNull()] $vm ) if ($vm.PowerState -eq 'PoweredOn') { return $true } else { try { Write-Verbose -Message 'Powering on VM' Start-VM -VM $vm -Verbose:...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_UpdateTools.ps1
_UpdateTools.ps1
function _UpdateTools { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $VM ) # VM must be powered on to upgrade tools if ($VM.PowerState -eq 'PoweredOn') { Write-Verbose -Message 'Updating tools with [NoReboot]' $VM | Update-Tools -No...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_WaitForVMTools.ps1
_WaitForVMTools.ps1
function _WaitForVMTools { param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [pscredential]$Credential ) $toolsTimeout = 20 $ipTimeout = 20 # Wait until VM tools is available and we have an IP $result = Wait-Tools -Vm $vm -Ti...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMDisks.ps1
_TestVMDisks.ps1
function _TestVMDisks { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DiskSpec ) begin { Write-Debug -Message '_TestVMDisks() starting' $vmDiskStorageF...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_DisconnectFromvCenter.ps1
_DisconnectFromvCenter.ps1
function _DisconnectFromvCenter { [cmdletbinding()] param( [parameter(Mandatory)] [string]$vCenter ) try { Write-Debug -Message "Disconnecting from vCenter [$vCenter]" Disconnect-VIServer -Server $vCenter -Force -Verbose:$false Write-Debug -Message "Disconnected ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetVMFolderPath.ps1
_GetVMFolderPath.ps1
function _GetVMFolderPath { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $VM ) $parent = $VM.Folder $path = $VM.Folder.Name While ($parent.ExtensionData.MoRef.Type -eq 'Folder') { $parent = $parent.Parent if ($parent.Name -ne 'vm') ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMRAM.ps1
_SetVMRAM.ps1
function _SetVMRAM { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNull()] [int]$RAM ) if ($vm.MemoryGB -ne $RAM) { $continue = $false # If VM is powered on, make sure we are...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetVMFolderByPath.ps1
_GetVMFolderByPath.ps1
# Taken with love from http://www.lucd.info/2012/05/18/folder-by-path/ # with a few minor modifications function _GetVMFolderByPath{ <# .SYNOPSIS Retrieve folders by giving a path .DESCRIPTION The function will retrieve a folder by it's path. The path can contain any type of leave (folder or datac...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_refreshHostStorageCache.ps1
_refreshHostStorageCache.ps1
function _RefreshHostStorageCache { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [pscredential]$Credential ) try { $ip = _GetGuestVMIPAddress -VM $vm $os = _GetGuestOS -VM $vm -Credential $creden...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetGuestOS.ps1
_GetGuestOS.ps1
function _GetGuestOS{ [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [pscredential]$Credential ) #Get guest operating system version try { $ip = _GetGuestVMIPAddress -VM $vm Write-Debug 'Queri...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMNICs.ps1
_TestVMNICs.ps1
function _TestVMNICs { }
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetGuestDisks.ps1
_SetGuestDisks.ps1
function _SetGuestDisks{ [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DiskSpec, [Parameter(Mandatory)] [pscredential]$Credential ) begin { Wri...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_FormatOldGuestDisk.ps1
_FormatOldGuestDisk.ps1
function _FormatOldGuestDisk { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $disk, [Parameter(Mandatory)] [ValidateNotNull()] $session, [ValidateSet('GPT', 'MBR')] [string]$PartitionStyle = 'GPT', [Parameter(Mandat...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMTools.ps1
_TestVMTools.ps1
function _TestVMTools { [cmdletbinding()] param( $VM ) # Possible values indicating tools need to be installed/updated $old = @('guestToolsNeedUpgrade', 'guestToolsNotInstalled') if ($VM.ExtensionData.Guest.ToolsVersionStatus -notin $old) { return $true } else { ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMNICs.ps1
_SetVMNICs.ps1
function _SetVMNICs { param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$NICSpec, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$CustomizationSpec, [string]$I...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMDiskSCSIController.ps1
_SetVMDiskSCSIController.ps1
function _SetVMDiskSCSIController { [cmdletbinding()] param( [parameter(Mandatory)] $VM, [parameter(Mandatory)] $Disk, [ValidateRange(0, 3)] [parameter(Mandatory)] [int]$ControllerId, # Missing BusNumber 7 on purpose [ValidateSet(0,1,2,...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMRAM.ps1
_TestVMRAM.ps1
function _TestVMRAM { [cmdletbinding()] param( $VM, [int]$RAM ) # VM matches memory if ($VM.MemoryGB -ne $RAM) { return $false } else { return $true } }
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_testTags.ps1
_testTags.ps1
function _TestTags { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNull()] [string]$Tags ) $result = $true # Get tag information from vCenter $desiredTags = $Tags | ConvertFrom-Json ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_RenameCDROM.ps1
_RenameCDROM.ps1
function _RenameCDROM { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $cim, [string]$DriveLetter = 'Z' ) $DriveLetter = "$DriveLetter`:" # If the VM has a cdrom, mount it as 'Z:' if (((Get-CimInstance -CimSession $cim -ClassName win32_cdro...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMDisks.ps1
_SetVMDisks.ps1
function _SetVMDisks { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$DiskSpec ) $configDisks = ConvertFrom-Json -InputObject $DiskSpec -Verbose:$false $vmDisks = @...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_ConnectTovCenter.ps1
_ConnectTovCenter.ps1
function _ConnectTovCenter { [cmdletbinding()] param( [string]$vCenter, [pscredential]$Credential ) if ($null -ne (Get-Module -Name VMware.VimAutomation* -ListAvailable -ErrorAction SilentlyContinue -Verbose:$false)) { Import-Module VMware.VimAutomation.Core -Verbose:$false ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMCPU.ps1
_TestVMCPU.ps1
function _TestVMCPU { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNull()] [int]$TotalvCPU, [Parameter(Mandatory)] [ValidateNotNull()] [int]$CoresPerSocket ) # VM mat...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_WaitForGuestCustomization.ps1
_WaitForGuestCustomization.ps1
function _WaitForGuestCustomization { param( [Parameter(Mandatory)] [ValidateNotNull()] $vm ) $timeout = 15 # Wait until VM has started Write-Verbose -Message 'Waiting for VM to start...' $sw = [diagnostics.stopwatch]::StartNew() while ($sw.elapsed.minutes -lt $tim...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestChefClient.ps1
_TestChefClient.ps1
function _TestGuestDisks { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [pscredential]$Credential ) begin { Write-Debug -Message '_TestChefClient() starting' } process { $pass = $true ...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_SetVMCPU.ps1
_SetVMCPU.ps1
function _SetVMCPU { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [ValidateNotNull()] [int]$TotalvCPU, [Parameter(Mandatory)] [ValidateNotNull()] [int]$CoresPerSocket ) [bool]$re...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMFolder.ps1
_TestVMFolder.ps1
function _TestVMFolder { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [string]$VMFolder ) $path = _GetVMFolderPath -VM $VM # Normalize slashes and strip out any leading or training '/' # so we can comp...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_MoveVM.ps1
_MoveVM.ps1
function _MoveVM { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [string]$VMFolder ) $folder = _GetVMFolderByPath -Path $VMFolder -ErrorAction SilentlyContinue if ($folder) { Write-Verbose -Message "M...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_FormatGuestDisk.ps1
_FormatGuestDisk.ps1
function _FormatGuestDisk { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNull()] $disk, [Parameter(Mandatory)] [ValidateNotNull()] $session, [ValidateSet('GPT', 'MBR')] [string]$PartitionStyle = 'GPT', [Parameter(Mandatory...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_CreateVM.ps1
_CreateVM.ps1
function _CreateVM { [cmdletbinding(DefaultParameterSetName='cluster')] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$VMTemplate, [Parameter(Mandatory, ParameterSetName...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_TestVMPowerState.ps1
_TestVMPowerState.ps1
function _TestVMPowerState { param( [Parameter(Mandatory)] [ValidateNotNull()] $vm, [Parameter(Mandatory)] [bool]$PowerOnAfterCreation ) switch ($PowerOnAfterCreation) { $true { return ($PowerOnAfterCreation -and ($vm.PowerState -eq 'PoweredOn'))...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/DSCResources/POSHOrigin_vSphere_VM/Helpers/_GetGuestDiskToVMDiskMapping.ps1
_GetGuestDiskToVMDiskMapping.ps1
# Based on https://communities.vmware.com/thread/528535?start=0&tstart=0 function _GetGuestDiskToVMDiskMapping { [cmdletbinding()] param ( [Parameter(Mandatory)] [ValidateNotNull()] $VM, [Parameter(Mandatory)] $cim, [Parameter(Mandatory)] [pscredential]...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/Examples/Example_VM.ps1
Example_VM.ps1
$DscConfigData = @{ AllNodes = @( @{ NodeName = "*" PSDscAllowPlainTextPassword = $true PSDscAllowDomainUser = $true } @{ NodeName = 'localhost' } ) } Configuration Example_VM { param( [string[]]$NodeName = 'localhost',...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/Examples/Example_POSHOrigin_VM.ps1
Example_POSHOrigin_VM.ps1
resource 'vsphere:vm' 'VM01' @{ ensure = 'present' description = 'Test VM' vCenter = 'vcenter01.local' datacenter = 'datacenter01' cluster = 'cluster01' vmTemplate = 'W2K12_R2_Std' customizationSpec = 'W2K12_R2' powerOnAfterCreation = $true totalvCPU = 2 coresPerSocket = 1 vR...
PowerShellCorpus/PowerShellGallery/POSHOrigin_vSphere/1.3.0/Examples/Example_POSHOrigin_with_defaults.ps1
Example_POSHOrigin_with_defaults.ps1
resource 'vsphere:vm' 'VM01' @{ defaults = '.\defaults.psd1' description = 'Test VM 01' }
PowerShellCorpus/PowerShellGallery/ISERemoteTab/1.5.1/SampleRemoteProfile.ps1
SampleRemoteProfile.ps1
#this is a sample remote profile script #each command must be a one-liner. Do not use block comments. Set-Location -path 'C:\' Clear-Host $PSVersionTable
PowerShellCorpus/PowerShellGallery/ISERemoteTab/1.5.1/New-ISERemoteTabForm.ps1
New-ISERemoteTabForm.ps1
#requires -version 4.0 #requires -module ISE Function New-ISERemoteForm { [cmdletbinding()] Param() Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName PresentationCore Add-Type -AssemblyName WindowsBase #define the form XAML [xml]$xaml=@" <Window xmlns="http://schemas.micr...
PowerShellCorpus/PowerShellGallery/ISERemoteTab/1.5.1/New-ISERemoteTab.ps1
New-ISERemoteTab.ps1
#requires -version 4.0 #requires -module ISE Function New-ISERemoteTab { [cmdletbinding(DefaultParameterSetName="Credential")] Param( [Parameter( Position = 0, Mandatory, HelpMessage = "Enter the name of a remote computer", ValueFromPipeline, ValueFromPipelineByPropertyName )] [Val...
PowerShellCorpus/PowerShellGallery/PS7Zip/1.3.0.1604/Compress-7Zip.ps1
Compress-7Zip.ps1
Function Compress-7Zip { <# .SYNOPSIS Create a compressed archive of a file or folder .DESCRIPTION Use Compress-7Zip to create a 7z, gzip, zip, bzip2 or tar archive. .EXAMPLE Compress-7Zip c:\scripts Create archive.zip in the current working folder of the folder c:\scripts ...
PowerShellCorpus/PowerShellGallery/PS7Zip/1.3.0.1604/Expand-7Zip.ps1
Expand-7Zip.ps1
Function Expand-7Zip { <# .SYNOPSIS Extract contents of a compressed archive file .DESCRIPTION Use Expand-7Zip to extract the contents of an archive. .EXAMPLE Expand-7Zip archive.zip Extract contents of archive.zip in the current working folder .EXAMPLE Expand-7Zip "c:\fol...
PowerShellCorpus/PowerShellGallery/PS7Zip/1.3.0.1604/Get-7Zip.ps1
Get-7Zip.ps1
Function Get-7Zip { <# .SYNOPSIS List contents of a compressed archive file .DESCRIPTION Use Get-7Zip to list the contents of an archive. .EXAMPLE Get-7Zip archive.zip List contents of archive.zip in the current working folder .EXAMPLE Get-7Zip "c:\folder\files.gz" ...