full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/WFTools/0.1.44/Join-Object.ps1 | Join-Object.ps1 | function Join-Object
{
<#
.SYNOPSIS
Join data from two sets of objects based on a common value
.DESCRIPTION
Join data from two sets of objects based on a common value
For more details, see the accompanying blog post:
http://ramblingcookiemonster.github.io/Join-Object/
... |
PowerShellCorpus/PowerShellGallery/WFTools/0.1.44/Get-InstalledSoftware.ps1 | Get-InstalledSoftware.ps1 | function Get-InstalledSoftware {
<#
.SYNOPSIS
Pull software details from registry on one or more computers
.DESCRIPTION
Pull software details from registry on one or more computers. Details:
-This avoids the performance impact and potential danger of using the WMI Win32_Product class
-The comp... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabHostConfiguration.ps1 | LabHostConfiguration.ps1 | function GetLabHostSetupConfiguration {
<#
.SYNOPSIS
Returns an array of hashtables defining the desired host configuration.
.DESCRIPTION
The GetLabHostSetupConfiguration function returns an array of hashtables used to determine whether the
host is in the desired configuration.
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabVMSnapshot.ps1 | LabVMSnapshot.ps1 | function RemoveLabVMSnapshot {
<#
.SYNOPSIS
Removes a VM snapshot.
#>
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()]
[System.String[]] $Name,
[Parameter(ValueFromPipelineByPropertyName)] [Validate... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabVMDiskFile.ps1 | LabVMDiskFile.ps1 | function SetLabVMDiskModule {
<#
.SYNOPSIS
Downloads (if required) PowerShell/DSC modules and expands
them to the destination path specified.
#>
[CmdletBinding()]
param (
## Lability PowerShell modules/DSC resource hashtable
[Parameter(Mandatory, ValueFromPipeline, V... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabVMDisk.ps1 | LabVMDisk.ps1 | function ResolveLabVMDiskPath {
<#
.SYNOPSIS
Resolves the specified VM name to it's target VHDX path.
#>
param (
## VM/node name.
[Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()]
[System.String] $Name,
[Parameter()] [ValidateSet('VHD','VHDX'... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabNode.ps1 | LabNode.ps1 | <# DEPRECATED
function TestLabNodeCertificate {
#
.SYNOPSIS
Tests whether the certificate is installed.
#
param (
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[System.String] $CertificatePath,
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabMedia.ps1 | LabMedia.ps1 | function NewLabMedia {
<#
.SYNOPSIS
Creates a new lab media object.
.DESCRIPTION
Permits validation of custom NonNodeData\Lability\Media entries.
#>
[CmdletBinding()]
param (
[Parameter(ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[Syste... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabVMDefault.ps1 | LabVMDefault.ps1 | function Reset-LabVMDefault {
<#
.SYNOPSIS
Reset the current lab virtual machine default settings back to defaults.
#>
[CmdletBinding(SupportsShouldProcess)]
[OutputType([System.Management.Automation.PSCustomObject])]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProc... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabSwitch.ps1 | LabSwitch.ps1 | function NewLabSwitch {
<#
.SYNOPSIS
Creates a new lab network switch object.
.DESCRIPTION
Permits validation of custom NonNodeData\Lability\Network entries.
#>
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param (
## Virtual switch name
[P... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabResource.ps1 | LabResource.ps1 | function Test-LabResource {
<#
.SYNOPSIS
Tests whether a lab's resources are present.
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
## PowerShell DSC configuration document (.psd1) containing lab metadata.
[Parameter(Mandatory, ValueFromPipeline)]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/LabVM.ps1 | LabVM.ps1 | function NewLabVM {
<#
.SYNOPSIS
Creates and configures a lab virtual machine.
.DESCRIPTION
Creates an new VM, creating the switch if required, injecting all
resources and snapshotting as required.
#>
[CmdletBinding(DefaultParameterSetName = 'PSCredential')]
param (
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-LabHostDscConfigurationPath.ps1 | Get-LabHostDscConfigurationPath.ps1 | function Get-LabHostDscConfigurationPath {
<#
.SYNOPSIS
Shortcut function to resolve the host's default ConfigurationPath property
#>
[CmdletBinding()]
[OutputType([System.String])]
param ( )
process {
$labHostDefaults = Get-ConfigurationData -Configuration Host;
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Expand-LabImage.ps1 | Expand-LabImage.ps1 | function Expand-LabImage {
<#
.SYNOPSIS
Writes a .wim image to a mounted VHD/(X) file.
#>
[CmdletBinding(DefaultParameterSetName = 'Index')]
param (
## File path to WIM file or ISO file containing the WIM image
[Parameter(Mandatory, ValueFromPipeline)]
[System.String... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Set-LabVirtualMachine.ps1 | Set-LabVirtualMachine.ps1 | function Set-LabVirtualMachine {
<#
.SYNOPSIS
Invokes the current configuration a virtual machine.
.DESCRIPTION
Invokes/sets a virtual machine configuration using the xVMHyperV DSC resource.
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProce... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-LabImage.ps1 | Resolve-LabImage.ps1 | function Resolve-LabImage {
<#
.SYNOPSIS
Resolves a Lability image by its path.
.DESCRIPTION
When running Remove-LabVM there is not always a configuration document supplied. This
causes issues removing a VMs VHD/X file. The ResolveLabImage function locates the image
by its... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Remove-LabVirtualMachine.ps1 | Remove-LabVirtualMachine.ps1 | function RemoveLabVirtualMachine {
<#
.SYNOPSIS
Removes the current configuration a virtual machine.
.DESCRIPTION
Invokes/sets a virtual machine configuration using the xVMHyperV DSC resource.
#>
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(Mandatory)]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Test-LabVirtualMachine.ps1 | Test-LabVirtualMachine.ps1 | function Test-LabVirtualMachine {
<#
.SYNOPSIS
Tests the current configuration a virtual machine.
.DESCRIPTION
Tests the current configuration a virtual machine using the xVMHyperV DSC resource.
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
[Parameter(... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-LabModule.ps1 | Resolve-LabModule.ps1 | function Resolve-LabModule {
<#
.SYNOPSIS
Returns the Node\DSCResource or Node\Module definitions from the
NonNodeData\Lability\DSCResource or NonNodeData\Lability\Module node.
.DESCRIPTION
Resolves lab modules/DSC resources names defined at the Node\DSCResource or
Node\Mo... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-ConfigurationPath.ps1 | Resolve-ConfigurationPath.ps1 | function Resolve-ConfigurationPath {
<#
.SYNOPSIS
Resolves a Lability image by its path.
.DESCRIPTION
When running Remove-LabVM there is not always a configuration document supplied. This
causes issues removing a VMs VHD/X file. The ResolveLabImage function locates the image
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-ConfigurationData.ps1 | Get-ConfigurationData.ps1 | function Get-ConfigurationData {
<#
.SYNOPSIS
Gets lab configuration data.
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.PSCustomObject])]
param (
[Parameter(Mandatory)]
[ValidateSet('Host','VM','Media','CustomMedia')]
[System.String] $Configura... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Start-ShellHWDetectionService.ps1 | Start-ShellHWDetectionService.ps1 | function Start-ShellHWDetectionService {
<#
.SYNOPSIS
Starts the ShellHWDetectionService - if present!
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
param ( )
process {
if (Get-Service -Name 'Shel... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-ConfigurationDataPath.ps1 | Resolve-ConfigurationDataPath.ps1 | function Resolve-ConfigurationDataPath {
<#
.SYNOPSIS
Resolves the lab configuration data path.
.NOTES
When -IncludeDefaultPath is specified, if the configuration data file is not found, the default
module configuration path is returned.
#>
[CmdletBinding()]
[OutputType(... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Copy-LabModule.ps1 | Copy-LabModule.ps1 | function Copy-LabModule {
<#
.SYNOPSIS
Copies Lability PowerShell and DSC Resource modules.
#>
[CmdletBinding(SupportsShouldProcess)]
param (
## Specifies a PowerShell DSC configuration document (.psd1) containing the lab configuration.
[Parameter(Mandatory, ValueFromPipeline... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Test-LabModuleVersion.ps1 | Test-LabModuleVersion.ps1 | function Test-LabModuleVersion {
<#
.SYNOPSIS
Tests whether an exising PowerShell module meets the minimum or required version
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
## Path to the module's manifest file
[Parameter(Mandatory, ValueFromPipeline, Value... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Start-DscConfigurationCompilation.ps1 | Start-DscConfigurationCompilation.ps1 | function Start-DscConfigurationCompilation {
<#
.SYNOPSIS
Compiles an individual DSC configuration as a job.
#>
[CmdletBinding()]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
[OutputType([System.IO.FileInfo])]
param (
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-NodePropertyValue.ps1 | Resolve-NodePropertyValue.ps1 | function Resolve-NodePropertyValue {
<#
.SYNOPSIS
Resolves a node's properites.
.DESCRIPTION
Resolves a lab virtual machine properties from the lab defaults, Node\* node
and Node\NodeName node.
Properties defined on the wildcard node override the lab defaults.
P... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-LabModuleCache.ps1 | Get-LabModuleCache.ps1 | function Get-LabModuleCache {
<#
.SYNOPSIS
Returns the requested cached PowerShell module zip [System.IO.FileInfo] object.
.NOTES
File system modules are not stored in the module cache.
#>
[CmdletBinding(DefaultParameterSetName = 'Name')]
[OutputType([System.IO.FileInfo])]
p... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Assert-LabConfigurationMof.ps1 | Assert-LabConfigurationMof.ps1 | function Assert-LabConfigurationMof {
<#
.SYNOPSIS
Checks for node MOF and meta MOF configuration files.
#>
[CmdletBinding()]
param (
## Lab DSC configuration data
[Parameter(Mandatory, ValueFromPipeline)]
[System.Collections.Hashtable]
[Microsoft.PowerShell... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-PSGalleryModuleUri.ps1 | Resolve-PSGalleryModuleUri.ps1 | function Resolve-PSGalleryModuleUri {
<#
.SYNOPSIS
Returns the direct download Uri for a PowerShell module hosted
on the PowerShell Gallery.
#>
[CmdletBinding()]
[OutputType([System.String])]
param (
## PowerShell DSC resource module name
[Parameter(Mandatory, ... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Set-ConfigurationData.ps1 | Set-ConfigurationData.ps1 | function Set-ConfigurationData {
<#
.SYNOPSIS
Saves lab configuration data.
#>
[CmdletBinding(SupportsShouldProcess)]
[OutputType([System.Management.Automation.PSCustomObject])]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')]
param (
[Paramet... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Stop-ShellHWDetectionService.ps1 | Stop-ShellHWDetectionService.ps1 | function Stop-ShellHWDetectionService {
<#
.SYNOPSIS
Stops the ShellHWDetectionService - if present!
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
param ( )
process {
if (Get-Service -Name 'ShellH... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-WindowsImageByName.ps1 | Get-WindowsImageByName.ps1 | function Get-WindowsImageByName {
<#
.SYNOPSIS
Locates the specified WIM image name by its index.
#>
[CmdletBinding()]
[OutputType([System.String])]
param (
# WIM image path
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.St... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-WindowsImageByIndex.ps1 | Get-WindowsImageByIndex.ps1 | function Get-WindowsImageByIndex {
<#
.SYNOPSIS
Locates the specified WIM image index by its name, i.e. SERVERSTANDARD or SERVERDATACENTERSTANDARD
.OUTPUTS
The WIM image index.
#>
[CmdletBinding()]
[OutputType([System.Int32])]
param (
# WIM image path
[Para... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-LabVMDiskGenerationPath.ps1 | Resolve-LabVMDiskGenerationPath.ps1 | function Resolve-LabVMGenerationDiskPath {
<#
.SYNOPSIS
Resolves the specified VM name's target VHD/X path.
#>
[CmdletBinding()]
param (
## VM/node name.
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.String] $Name,
#... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Add-LabImagePackage.ps1 | Add-LabImagePackage.ps1 | function Add-LabImageWindowsPackage {
<#
.SYNOPSIS
Adds a Windows package to an image.
#>
[CmdletBinding()]
param (
## Windows packages (.cab) files to add to the image after expansion
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNull()]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-VhdHierarchy.ps1 | Resolve-VhdHierarchy.ps1 | <#
The MIT License (MIT)
Copyright (c) 2015 Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Test-ConfigurationPath.ps1 | Test-ConfigurationPath.ps1 | function Test-ConfigurationPath {
<#
.SYNOPSIS
Tests the specified path for a computer's .mof file.
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
## Lab vm/node name
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Valid... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Set-LabVMDiskFile.ps1 | Set-LabVMDiskFile.ps1 | function Set-LabVMDiskFile {
<#
.SYNOPSIS
Copies Lability files to a node's VHD(X) file.
.DESCRIPTION
Copies the Lability bootstrap file, SetupComplete.cmd, unattend.xml,
mof files, certificates and PowerShell/DSC resource modules to a
VHD(X) file.
#>
[CmdletBinding(... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-LabVMImage.ps1 | Resolve-LabVMImage.ps1 | function Resolve-LabVMImage {
<#
.SYNOPSIS
Resolves a virtual machine's Lability image.
#>
[CmdletBinding()]
param (
## VM name
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[System.String] $Name
)
process {
Get-VM -N... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Remove-ConfigurationData.ps1 | Remove-ConfigurationData.ps1 | function Remove-ConfigurationData {
<#
.SYNOPSIS
Removes custom lab configuration data file.
#>
[CmdletBinding(SupportsShouldProcess)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')]
param (
[Parameter(Mandatory)]
[ValidateSet('Host','VM'... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Get-LabVirtualMachineProperty.ps1 | Get-LabVirtualMachineProperty.ps1 | function Get-LabVirtualMachineProperty {
<#
.SYNOPSIS
Gets the properties required by DSC xVMHyperV.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[System.String] $Name,
[Parameter(Mandatory)]
[ValidateNotNullOrEmp... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Add-LabImageOptionalFeature.ps1 | Add-LabImageOptionalFeature.ps1 | function Add-LabImageWindowsOptionalFeature {
<#
.SYMOPSIS
Enables Windows optional features to an image.
#>
[CmdletBinding()]
param (
## Source package file path
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.String] $ImagePath... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/Resolve-ProgramFilesFolder.ps1 | Resolve-ProgramFilesFolder.ps1 | function Resolve-ProgramFilesFolder {
<#
.SYNOPSIS
Resolves known localized %ProgramFiles% directories.
.LINK
https://en.wikipedia.org/wiki/Program_Files
#>
[CmdletBinding(DefaultParameterSetName = 'Path')]
[OutputType([System.IO.DirectoryInfo])]
param (
## Root pat... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Private/ConvertTo-ConfigurationData.ps1 | ConvertTo-ConfigurationData.ps1 | function ConvertTo-ConfigurationData {
<#
.SYNOPSIS
Converts a file path string to a hashtable. This mimics the -ConfigurationData parameter of the
Start-DscConfiguration cmdlet.
#>
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param (
[Parameter... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Test-LabStatus.ps1 | Test-LabStatus.ps1 | function Test-LabStatus {
<#
.SYNOPSIS
Queries computers' LCM state to determine whether an existing DSC configuration has applied successfully.
.EXAMPLE
Test-LabStatus -ComputerName CONTROLLER, XENAPP
Tests the CONTROLLER and XENAPP computers' LCM state, using the current user c... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Get-LabHostDefault.ps1 | Get-LabHostDefault.ps1 | function Get-LabHostDefault {
<#
.SYNOPSIS
Gets the lab host's default settings.
.DESCRIPTION
The Get-LabHostDefault cmdlet returns the lab host's current settings.
.LINK
Set-LabHostDefault
Reset-LabHostDefault
#>
[CmdletBinding()]
[OutputType([System.Manag... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Test-LabVM.ps1 | Test-LabVM.ps1 | function Test-LabVM {
<#
.SYNOPSIS
Checks whether the (external) lab virtual machine is configured as required.
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
## Specifies the lab virtual machine/node name.
[Parameter(ValueFromPipeline)]
[ValidateNo... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Set-LabHostDefault.ps1 | Set-LabHostDefault.ps1 | function Set-LabHostDefault {
<#
.SYNOPSIS
Sets the lab host's default settings.
.DESCRIPTION
The Set-LabHostDefault cmdlet sets one or more lab host default settings.
.LINK
Get-LabHostDefault
Reset-LabHostDefault
#>
[CmdletBinding(SupportsShouldProcess)]
[... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Stop-Lab.ps1 | Stop-Lab.ps1 | function Stop-Lab {
<#
.SYNOPSIS
Stops all VMs in a lab in a predefined order.
.DESCRIPTION
The Stop-Lab cmdlet stops all nodes defined in a PowerShell DSC configuration document, in a preconfigured
order.
Unlike the standard Stop-VM cmdlet, the Stop-Lab cmdlet will read... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Reset-Lab.ps1 | Reset-Lab.ps1 | function Reset-Lab {
<#
.SYNOPSIS
Reverts all VMs in a lab back to their initial configuration.
.DESCRIPTION
The Reset-Lab cmdlet will reset all the nodes defined in a PowerShell DSC configuration document, back to their
initial state. If virtual machines are powered on, they will... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Test-LabConfiguration.ps1 | Test-LabConfiguration.ps1 | function Test-LabConfiguration {
<#
.SYNOPSIS
Tests the configuration of all VMs in a lab.
.DESCRIPTION
The Test-LabConfiguration determines whether all nodes defined in a PowerShell DSC configuration document
are configured correctly and returns the results.
WANRING: On... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/New-LabImage.ps1 | New-LabImage.ps1 | function New-LabImage {
<#
.SYNOPSIS
Creates a new master/parent lab image.
.DESCRIPTION
The New-LabImage cmdlet starts the creation of a lab VHD(X) master image from the specified media Id.
Lability will automatically create lab images as required. If there is a need to manally ... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Restore-Lab.ps1 | Restore-Lab.ps1 | function Restore-Lab {
<#
.SYNOPSIS
Restores all lab VMs to a previous configuration.
.DESCRIPTION
The Restore-Lab reverts all the nodes defined in a PowerShell DSC configuration document, back to a
previously captured configuration.
When creating the snapshots, they are... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Start-Lab.ps1 | Start-Lab.ps1 | function Start-Lab {
<#
.SYNOPSIS
Starts all VMs in a lab in a predefined order.
.DESCRIPTION
The Start-Lab cmdlet starts all nodes defined in a PowerShell DSC configuration document, in a preconfigured
order.
Unlike the standard Start-VM cmdlet, the Start-Lab cmdlet wil... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Remove-LabVM.ps1 | Remove-LabVM.ps1 | function Remove-LabVM {
<#
.SYNOPSIS
Removes a bare-metal virtual machine and differencing VHD(X).
.DESCRIPTION
The Remove-LabVM cmdlet removes a virtual machine and it's VHD(X) file.
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
param (
## Virtual ma... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/New-LabVM.ps1 | New-LabVM.ps1 | function New-LabVM {
<#
.SYNOPSIS
Creates a simple bare-metal virtual machine.
.DESCRIPTION
The New-LabVM cmdlet creates a bare virtual machine using the specified media. No bootstrap or DSC configuration is applied.
NOTE: The mandatory -MediaId parameter is dynamic and is not di... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Get-LabVM.ps1 | Get-LabVM.ps1 | function Get-LabVM {
<#
.SYNOPSIS
Retrieves the current configuration of a VM.
.DESCRIPTION
Gets a virtual machine's configuration using the xVMHyperV DSC resource.
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
## Specifies the lab virtual machine/node... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Reset-LabVM.ps1 | Reset-LabVM.ps1 | function Reset-LabVM {
<#
.SYNOPSIS
Recreates a lab virtual machine.
.DESCRIPTION
The Reset-LabVM cmdlet deletes and recreates a lab virtual machine, reapplying the MOF.
To revert a single VM to a previous state, use the Restore-VMSnapshot cmdlet. To revert an entire lab environm... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Reset-LabHostDefault.ps1 | Reset-LabHostDefault.ps1 | function Reset-LabHostDefault {
<#
.SYNOPSIS
Resets lab host default settings to default.
.DESCRIPTION
The Reset-LabHostDefault cmdlet resets the lab host's settings to default values.
.LINK
Get-LabHostDefault
Set-LabHostDefault
#>
[CmdletBinding(SupportsShouldP... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Get-LabImage.ps1 | Get-LabImage.ps1 | function Get-LabImage {
<#
.SYNOPSIS
Gets master/parent disk image.
.DESCRIPTION
The Get-LabImage cmdlet returns current master/parent disk image properties.
.PARAMETER Id
Specifies the media Id of the image to return. If this parameter is not specified, all images are returne... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Wait-Lab.ps1 | Wait-Lab.ps1 | function Wait-Lab {
<#
.SYNOPSIS
Queries computers' LCM state, using current user credentials, waiting for DSC configurations to be applied.
.EXAMPLE
Wait-Lab -ComputerName CONTROLLER, XENAPP
Connects to the CONTROLLER and XENAPP machine to query and Wait for the LCM to finish ap... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Test-LabImage.ps1 | Test-LabImage.ps1 | function Test-LabImage {
<#
.SYNOPSIS
Tests whether a master/parent lab image is present.
.DESCRIPTION
The Test-LabImage cmdlet returns whether a specified disk image is present.
.PARAMETER Id
Specifies the media Id of the image to test.
.PARAMETER ConfigurationData
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Start-DscCompilation.ps1 | Start-DscCompilation.ps1 | function Start-DscCompilation {
<#
.SYNOPSIS
Starts compilation of one or more DSC configurations.
.DESCRIPTION
The Start-DscCompilation cmdlet can compile multiple PowerShell DSC configurations (.ps1 files), in parallel
using jobs. Each PowerShell DSC configuration (.ps1) is loade... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Remove-LabConfiguration.ps1 | Remove-LabConfiguration.ps1 | function Remove-LabConfiguration {
<#
.SYNOPSIS
Removes all VMs and associated snapshots of all nodes defined in a PowerShell DSC configuration document.
.DESCRIPTION
The Remove-LabConfiguration removes all virtual machines that have a corresponding NodeName defined in the
AllNode ... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Get-LabStatus.ps1 | Get-LabStatus.ps1 | function Get-LabStatus {
<#
.SYNOPSIS
Queries computers' LCM state to determine whether an existing DSC configuration has applied.
.EXAMPLE
Get-LabStatus -ComputerName CONTROLLER, XENAPP
Queries the CONTROLLER and XENAPP computers' LCM state using the current user credential.
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Install-LabModule.ps1 | Install-LabModule.ps1 | function Install-LabModule {
<#
.SYNOPSIS
Installs Lability PowerShell and DSC resource modules.
.DESCRIPTION
The Install-LabModule cmdlet installs PowerShell modules and/or DSC resource modules from Lability's
module cache in to the local system. The DSC resources and/or PowerShel... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Checkpoint-Lab.ps1 | Checkpoint-Lab.ps1 | function Checkpoint-Lab {
<#
.SYNOPSIS
Snapshots all lab VMs in their current configuration.
.DESCRIPTION
The Checkpoint-Lab creates a VM checkpoint of all the nodes defined in a PowerShell DSC configuration document.
When creating the snapshots, they will be created using the snap... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Start-LabConfiguration.ps1 | Start-LabConfiguration.ps1 | function Start-LabConfiguration {
<#
.SYNOPSIS
Invokes the deployment and configuration of a VM for each node defined in a PowerShell DSC configuration
document.
.DESCRIPTION
The Start-LabConfiguration initiates the configuration of all nodes defined in a PowerShell DSC configurati... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Clear-ModulePath.ps1 | Clear-ModulePath.ps1 | function Clear-ModulePath {
<#
.SYNOPSIS
Removes all PowerShell modules installed in a given scope.
.DESCRIPTION
The Clear-ModulePath removes all existing PowerShell module and DSC resources from either the current user's
or the local machine's module path.
.PARAMETER Scope
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Src/Public/Clear-LabModuleCache.ps1 | Clear-LabModuleCache.ps1 | function Clear-LabModuleCache {
<#
.SYNOPSIS
Removes all cached modules from the Lability module cache.
.DESCRIPTION
The Clear-LabModuleCache removes all cached PowerShell module and DSC resource modules stored in Lability's
internal cache.
.PARAMETER Force
Forces th... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Examples/NanoContainerExample.ps1 | NanoContainerExample.ps1 | Configuration NanoContainerExample {
<#
Requires the following DSC resources:
xNetworking: https://github.com/PowerShell/xNetworking
xPSDesiredStateConfiguration: https://github.com/PowerShell/xPSDesiredStateConfiguration
#>
param ()
Import-DscResource -Module xNe... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Examples/TestLabGuide.ps1 | TestLabGuide.ps1 | Configuration TestLabGuide {
<#
Requires the following custom DSC resources:
xComputerManagement: https://github.com/PowerShell/xComputerManagement
xNetworking: https://github.com/PowerShell/xNetworking
xActiveDirectory: https://github.com/PowerShell/xActiveDirectory
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Examples/NanoExample.ps1 | NanoExample.ps1 | Configuration NanoExample {
<#
Requires the following DSC resources:
xNetworking: https://github.com/PowerShell/xNetworking
xPSDesiredStateConfiguration: https://github.com/PowerShell/xPSDesiredStateConfiguration
#>
param ()
Import-DscResource -Module xNetworking,... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Examples/NanoComputeExample.ps1 | NanoComputeExample.ps1 | Configuration NanoComputeExample {
<#
Requires the following DSC resources:
xNetworking: https://github.com/PowerShell/xNetworking
xPSDesiredStateConfiguration: https://github.com/PowerShell/xPSDesiredStateConfiguration
#>
param ()
Import-DscResource -Module xNetw... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/GitHub.ps1 | GitHub.ps1 | function ResolveGitHubModuleUri {
<#
.SYNOPSIS
Resolves the correct GitHub URI for the specified Owner, Repository and Branch.
#>
[CmdletBinding()]
[OutputType([System.Uri])]
param (
## GitHub repository owner
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/BootStrap.ps1 | BootStrap.ps1 | function NewBootStrap {
<#
.SYNOPSIS
Creates a lab DSC BootStrap script block.
#>
[CmdletBinding()]
[OutputType([System.String])]
param (
[Parameter(ValueFromPipelineByPropertyName)]
[System.Management.Automation.SwitchParameter] $CoreCLR,
## Custom default sh... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/DscModule.ps1 | DscModule.ps1 | function ExpandDscModule {
<#
.SYNOPSIS
Extracts a DSC resource .zip archive using Windows Explorer and removes -master or -dev directory suffixes.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[System.String] $ModuleName,
[Parameter(Mandatory)]
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/DscResource.ps1 | DscResource.ps1 | function ImportDscResource {
<#
.SYNOPSIS
Imports a DSC module resource.
.DESCRIPTION
Imports a DSC resource as Test-<Prefix>TargetResource and Set-<Prefix>TargetResource etc.
#>
[CmdletBinding()]
param (
## DSC resource's module name containing the resource
[P... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/DiskImage.ps1 | DiskImage.ps1 | function GetDiskImageDriveLetter {
<#
.SYNOPSIS
Return a disk image's associated/mounted drive letter.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[System.Object] $DiskImage,
[Parameter(Mandatory)]
[ValidateSet('Basic','System','... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/Resource.ps1 | Resource.ps1 | function SetResourceChecksum {
<#
.SYNOPSIS
Creates a resource's checksum file.
#>
param (
## Path of file to create the checksum of
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.String] $Path
)
process {
$check... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/Dism.ps1 | Dism.ps1 | function ResolveDismPath {
<#
.SYNOPSIS
Resolves the specified path to a path to DISM dll.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[System.String] $Path
)
process {
if (-not (Test-Path -Path ... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/Internal.ps1 | Internal.ps1 | function NewDirectory {
<#
.SYNOPSIS
Creates a filesystem directory.
.DESCRIPTION
The New-Directory cmdlet will create the target directory if it doesn't already exist. If the target path
already exists, the cmdlet does nothing.
#>
[CmdletBinding(DefaultParameterSetName = 'ByStr... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/UnattendXml.ps1 | UnattendXml.ps1 | function NewUnattendXml {
<#
.SYNOPSIS
Creates a Windows unattended installation file.
.DESCRIPTION
Creates an unattended Windows 8/2012 installation file that will configure
an operating system deployed from a WIM file, deploy the operating system
and ensure that Powershell's... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/Module.ps1 | Module.ps1 | function GetModule {
<#
.SYNOPSIS
Tests whether an exising PowerShell module meets the minimum or required version
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmp... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/ZipArchive.ps1 | ZipArchive.ps1 | function ExpandZipArchive {
<#
.SYNOPSIS
Extracts a Zip archive.
.NOTES
This is an internal function and should not be called directly.
.LINK
This function is derived from the VirtualEngine.Compression (https://github.com/VirtualEngine/Compression) module.
.OUTPUTS
... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/DscResourceModule.ps1 | DscResourceModule.ps1 | function TestDscResourceModule {
<#
.SYNOPSIS
Tests whether the specified PowerShell module directory is a DSC resource.
.DESCRIPTION
The TestDscResourceModule determines whether the specified path is a PowerShell DSC resource module. This is
used to only copy DSC resources to a VM... |
PowerShellCorpus/PowerShellGallery/Lability/0.11.0/Lib/Iso.ps1 | Iso.ps1 | function ExpandIso {
<#
.SYNOPSIS
Expands an ISO disk image resource
#>
param (
## Source ISO file path
[Parameter(Mandatory, ValueFromPipeline)]
[System.String] $Path,
## Destination folder path
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/tests/New-AzureVPNClientCertificate.tests.ps1 | New-AzureVPNClientCertificate.tests.ps1 | if(-not (Get-Module azureVpnP2SSelfSignedCertificate)) {
$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace('tests', '')
Import-Module (Join-Path $here 'azureVpnP2SSelfSignedCertificate.psd1')
}
InModuleScope -moduleName azureVpnP2SSelfSignedCertificate {
Describe 'New-AzureVPNClientCerti... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/tests/_scriptAnalyer.tests.ps1 | _scriptAnalyer.tests.ps1 | $here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace('tests', '')
$scriptsModules = Get-ChildItem $here -Include *.psd1, *.psm1, *.ps1 -Exclude *.tests.ps1 -Recurse
Describe 'General - Testing all scripts and modules against the Script Analyzer Rules' {
Context "Checking files to test exist and Invok... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/tests/Export-AzureVPNCertificate.tests.ps1 | Export-AzureVPNCertificate.tests.ps1 | if(-not (Get-Module azureVpnP2SSelfSignedCertificate)) {
$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace('tests', '')
Import-Module (Join-Path $here 'azureVpnP2SSelfSignedCertificate.psd1')
}
InModuleScope -moduleName azureVpnP2SSelfSignedCertificate {
$SecureString = @"
<Objs Version="1.... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/tests/New-AzureVPNRootCertificate.tests.ps1 | New-AzureVPNRootCertificate.tests.ps1 | if(-not (Get-Module azureVpnP2SSelfSignedCertificate)) {
$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace('tests', '')
Import-Module (Join-Path $here 'azureVpnP2SSelfSignedCertificate.psd1')
}
InModuleScope -moduleName azureVpnP2SSelfSignedCertificate {
Describe 'New-AzureVPNRootCertifi... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/examples/rootCertificate.example.ps1 | rootCertificate.example.ps1 | Login-AzureAccount
$vNetGatewayName = 'VNet1GW'
$resourceGroupName = 'TestRG'
$exportPath = 'c:\a'
$rootCert = New-AzureVPNRootCertificate -subject 'azureVPNRootCertTest'
$rootCert | Export-AzureVPNCertificate -cer -path $exportPath
$uploadRootCert = @{
VirtualNetw... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/examples/_full.example.ps1 | _full.example.ps1 | Login-AzureAccount
$vNetGatewayName = 'VNet1GW'
$resourceGroupName = 'TestRG'
$pfxpassword = Read-Host -AsSecureString
$exportPath = 'c:\a'
$numberOfClientCerts = 20
$rootCert = New-AzureVPNRootCertificate -subject 'azureVPNRootCertTest'
$rootCert | Export-AzureVPNCertificate -cer ... |
PowerShellCorpus/PowerShellGallery/azureVpnP2SSelfSignedCertificate/1.0.0.1/examples/clientCertificate.example.ps1 | clientCertificate.example.ps1 | $count = 0
while($count -le $numberOfClientCerts)
{
$clientCertName = 'azureVPNClient.' + $count
$rootCert | New-AzureVPNClientCertificate -thumbPrint 'sddddffddffd' -subject $clientCertName | Export-AzureVPNCertificate -path $exportPath -pfx -password $pfxpassword -removeAfterExport
$count++
} |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/vSphereDSCHelper.ps1 | vSphereDSCHelper.ps1 | enum VmwFolderType {
Yellow
Blue
}
function Enable-PowerCLI
{
<#
.SYNOPSIS
Load PowerCLI modules and PSSnapins
.DESCRIPTION
This function will load all requested PowerCLI
modules and PSSnapins.
The function will, depending on the installed PowerCLI version,
determine what needs to be lo... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/PowerCLI/pcli01-PowerCLI.ps1 | pcli01-PowerCLI.ps1 | # Configure PowerCLi on vEng
#
# Tested platform:
# Windows 2012 R2
# PowerShell v5 Production Preview
#
$tgtName = 'vEng.local.lab'
$pcliName = 'VMware-PowerCLI-6.3.0-3737840.exe'
$configName = $tgtName.Split('.')[0]
Configuration $configName
{
Import-DscResource -ModuleName PSDesiredStateConfigur... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwDatacenter/cd01-vCenter-Datacenter.ps1 | cd01-vCenter-Datacenter.ps1 | enum Ensure {
Absent
Present
}
$tgtName = 'vEng.local.lab'
$configName = 'vmw'
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-DscResource -ModuleName vSphereDSC
Node $AllNodes.NodeName
{
$number = 0
... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwDatacenter/cd02-vCenter-Datacenter.ps1 | cd02-vCenter-Datacenter.ps1 | enum Ensure {
Absent
Present
}
$tgtName = 'vEng.local.lab'
$configName = 'vmw'
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-DscResource -ModuleName vSphereDSC
Node $AllNodes.NodeName
{
$number = 0
... |
PowerShellCorpus/PowerShellGallery/vSphereDSC/1.0.2.1/Configurations/VmwDatacenter/cd03-vCenter-Datacenter.ps1 | cd03-vCenter-Datacenter.ps1 | enum Ensure {
Absent
Present
}
$tgtName = 'vEng.local.lab'
$configName = 'vmw'
Configuration $configName
{
param(
[System.Management.Automation.PSCredential]$Credential
)
Import-DscResource -ModuleName vSphereDSC
Node $AllNodes.NodeName
{
$number = 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.