full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/private/switch.ps1
switch.ps1
<# .SYNOPSIS Returns the name of the Management Switch to use for this lab. .DESCRIPTION Each lab has a unique private management switch created for it. All Virtual Machines in the Lab are connected to the switch. This function returns the name of this swtich for the provided lab configuratio...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/private/dsc.ps1
dsc.ps1
<# .SYNOPSIS Get a list of all Resources imported in a DSC Config .DESCRIPTION Uses RegEx to pull a list of Resources that are imported in a DSC Configuration using the Import-DSCResource cmdlet. If The -ModuleVersion parameter is included then the ModuleVersion property in the returned Lab...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/private/vhd.ps1
vhd.ps1
<# .SYNOPSIS Initialized a VM VHD for first boot by applying any required files to the image. .DESCRIPTION This function mounts a VM boot VHD image and applies the following files from the LabBuilder Files folder to it: 1. Unattend.xml - a Windows Unattend.xml file. 2. SetupComplete.c...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/private/vm.ps1
vm.ps1
<# .SYNOPSIS Creates the folder structure that will contain a Lab Virtual Machine. .DESCRIPTION Creates a standard Hyper-V Virtual Machine folder structure as well as additional folders for containing configuration files for DSC. .PARAMETER vmpath The path to the folder where the Virtual Machine ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/resource.ps1
resource.ps1
<# .SYNOPSIS Gets an array of Module Resources from a Lab. .DESCRIPTION Takes a provided Lab and returns the list of module resources required for this Lab. .PARAMETER Lab Contains the Lab object that was loaded by the Get-Lab object. .PARAMETER Name An optional array of Module names. Onl...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/vmtemplate.ps1
vmtemplate.ps1
<# .SYNOPSIS Gets an Array of VM Templates for a Lab. .DESCRIPTION Takes the provided Lab and returns the list of Virtul Machine template machines that will be used to create the Virtual Machines in this lab. This list is usually passed to Initialize-LabVMTemplate. .PARAMETER Lab Contains the L...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/switch.ps1
switch.ps1
<# .SYNOPSIS Gets an array of switches from a Lab. .DESCRIPTION Takes a provided Lab and returns the array of LabSwitch objects required for this Lab. This list is usually passed to Initialize-LabSwitch to configure the switches required for this lab. .PARAMETER Lab Contains the Lab object that w...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/lab.ps1
lab.ps1
<# .SYNOPSIS Loads a Lab Builder Configuration file and returns a Lab object .DESCRIPTION Takes the path to a valid LabBuilder Configiration XML file and loads it. It will perform simple validation on the XML file and throw an exception if any of the validation tests fail. At load time it...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/vm.ps1
vm.ps1
<# .SYNOPSIS Gets an Array of LabVM objects from a Lab. .DESCRIPTION Takes the provided Lab and returns the list of VM objects that will be created in this lab. This list is usually passed to Initialize-LabVM. .PARAMETER Lab Contains the Lab Builder Lab object that was loaded by the Get-Lab objec...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/lib/public/templatevhd.ps1
templatevhd.ps1
<# .SYNOPSIS Gets an Array of TemplateVHDs for a Lab. .DESCRIPTION Takes a provided Lab and returns the list of Template Disks that will be used to create the Virtual Machines in this lab. This list is usually passed to Initialize-LabVMTemplateVHD. It will validate the paths to the ISO fold...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/support/Convert-WindowsImage.ps1
Convert-WindowsImage.ps1
function Convert-WindowsImage { <# .NOTES Copyright (c) Microsoft Corporation. All rights reserved. Use of this sample source code is subject to the terms of the Microsoft license agreement under which you licensed this sample source code. If you did not accept the ter...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/support/Convert-XSDToMD.ps1
Convert-XSDToMD.ps1
<# .Synopsis Uses the MSXSL.EXE to apply an XML Stylesheet Transformation to an XML file. .Parameter XmlFile The full path to the XML file to transform. .Parameter XslFile The full path to the XSLT file to use as the transformation. .Parameter OutputFile The full path to the output file to create. #> para...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/support/Convert-LabBuilderConfigSchemaToMD.ps1
Convert-LabBuilderConfigSchemaToMD.ps1
<# .Synopsis Creates the ..\schema\labbuilderconfig-schema.md from the ..\schema\labbuilderconfig-schema.xsd using the transform\labbuilderconfig-schema-transformtomd.xsl transformation file. #> $XMLFile = Join-Path -Path $PSScriptRoot -ChildPath '..\schema\labbuilderconfig-schema.xsd' $XSLFile = Join-Path -...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/support/New-SelfSignedCertificateEx.ps1
New-SelfSignedCertificateEx.ps1
##################################################################### # New-SelfSignedCertificateEx.ps1 # Version 1.0 # # Creates self-signed certificate. This tool is a base replacement # for deprecated makecert.exe # # Vadims Podans (c) 2013 # http://en-us.sysadmins.lv/ ######################################...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_NPS.DSC.ps1
MEMBER_NPS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_NPS .Desription Builds a Server that is joined to a domain and then contains NPS/Radius components. .Requires Windows Server 2012 R2...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FAILOVERCLUSTER_FS.DSC.ps1
MEMBER_FAILOVERCLUSTER_FS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FAILOVERCLUSTER_FS .Desription Builds a Network failover clustering node for use as a File Server. It also optionally starts the iSCS...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_WDS.DSC.ps1
MEMBER_WDS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_WDS .Desription Builds a Server that is joined to a domain and then installs WSUS components. .Parameters: DomainName = "L...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FILESERVER_ISCSI.DSC.ps1
MEMBER_FILESERVER_ISCSI.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FILESERVER_ISCSI .Desription Builds a Server that is joined to a domain and then made into a File Server. Configures a iSCSI targets ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_DHCPDNS.DSC.ps1
STANDALONE_DHCPDNS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_DHCPDNS .Desription Builds a Standalone DHCP and DNS Server. .Parameters: Scopes = @( @{ Name = 'Site A Primary'; ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FAILOVERCLUSTER_DHCP.DSC.ps1
MEMBER_FAILOVERCLUSTER_DHCP.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FAILOVERCLUSTER_DHCP .Desription Builds a Network failover clustering node for use as a DHCP Server. It also optionally starts the iS...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DSCPULLSERVER.DSC.ps1
MEMBER_DSCPULLSERVER.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DSCPULLSERVER .Desription Builds a Server that is joined to a domain and then made into an DSC Pull Server. .Parameters: DomainName ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_ROOTCA.DSC.ps1
MEMBER_ROOTCA.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_ROOTCA .Desription Builds an Enterprise Root CA. .Parameters: DomainName = "LABBUILDER.COM" DomainAdminPassword = "P@ssword!1" ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FILESERVER_FSRMTEST.DSC.ps1
MEMBER_FILESERVER_FSRMTEST.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FILESERVER_FSRMTEST .Desription Builds a Server that is joined to a domain and then made into a File Server. Includes tests for FSRM ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_ROOTCA_NOSUBCA.DSC.ps1
STANDALONE_ROOTCA_NOSUBCA.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_ROOTCA_NOSUBCA .Desription Builds a Standalone Root CA with no Sub CAs. .Parameters: CACommonName = "LABBUILDER.COM Root...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_JENKINS.DSC.ps1
MEMBER_JENKINS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_JENKINS .Desription Builds a Windows Server, joins it to a Domain and installs Jenkins CI on it. .Parameters: DomainName = "LABBUILD...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_SQLSERVER2014.DSC.ps1
MEMBER_SQLSERVER2014.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_SQLSERVER2014 .Desription Builds a Server that is joined to a domain and then installs SQL Server 2014. It will install SQLServer fro...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_JENKINS.DSC.ps1
STANDALONE_JENKINS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_JENKINS .Desription Builds a Windows Server and installs Jenkins CI on it. .Parameters: JenkinsPort = 80 ######################...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DEFAULT.DSC.ps1
MEMBER_DEFAULT.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DEFAULT .Desription Builds a Server that is joined to a domain. .Parameters: DomainName = "LABBUILDER.COM" DomainAdminPassword ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_ADFS.DSC.ps1
MEMBER_ADFS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_ADFS .Desription Builds a Server that is joined to a domain and then made into an ADFS Server using WID. .Parameters: DomainName = "...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DNS.DSC.ps1
MEMBER_DNS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DNS .Desription Builds a Server that is joined to a domain and then made into a DNS Server. .Parameters: DomainName = "LABBUILDER.CO...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_SUBCA.DSC.ps1
MEMBER_SUBCA.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_SUBCA .Desription Builds a Enterprise Subordinate\Issuing CA. .Parameters: DomainName = "LABBUILDER.COM" DomainAdminPassword = ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FAILOVERCLUSTER_HV.DSC.ps1
MEMBER_FAILOVERCLUSTER_HV.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FAILOVERCLUSTER_HV .Desription Builds a Network failover clustering node Hyper-V. It also optionally starts the iSCSI Initiator and c...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_WSUS.DSC.ps1
MEMBER_WSUS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_WSUS .Desription Builds a Server that is joined to a domain and then installs WSUS components. Requires cMicrosoftUpdate resource fro...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_DEFAULT.DSC.ps1
STANDALONE_DEFAULT.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_DEFAULT .Desription Builds a Standalone computer with no additional DSC resources. .Parameters: ####################################...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_NPS_DFSTEST.DSC.ps1
MEMBER_NPS_DFSTEST.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_NPS_SPECIAL .Desription Builds a Server that is joined to a domain and then contains NPS/Radius components. ** This is a special ve...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_INTERNET.DSC.ps1
STANDALONE_INTERNET.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_INTERNET .Desription Builds a Standalone DHCP, DNS and IIS Server to simulate the Internet. See http://blog.superuser.com/2011/05...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_BRANCHCACHE_HOST.DSC.ps1
MEMBER_BRANCHCACHE_HOST.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_BRANCHCACHE_HOST .Desription Builds a Server that is joined to a domain and then made into a BranchCache Hosted Mode Server. .Parameters:...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_CONTAINER_HOST.DSC.ps1
MEMBER_CONTAINER_HOST.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_CONTAINER_HOST .Desription Builds a Server that is joined to a domain and then made into a Container Host with Docker. This should ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/DC_FORESTPRIMARY.DSC.ps1
DC_FORESTPRIMARY.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title DC_FORESTPRIMARY .Desription Builds a Domain Controller as the first DC in a forest with the name of the Domain Name parameter passed. ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_WEBSERVER.DSC.ps1
MEMBER_WEBSERVER.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_WEBSERVER .Desription Builds a Server that is joined to a domain and then made into an IIS Web Application Server. .Parameters: Doma...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_REMOTEACCESS.DSC.ps1
MEMBER_REMOTEACCESS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_REMOTEACCESS .Desription Builds a Server that is joined to a domain and then contains Remote Access components. .Parameters: DomainN...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/DC_SECONDARY.DSC.ps1
DC_SECONDARY.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title DC_SECONDARY .Desription Builds a Domain Controller and adds it to the existing domain provided in the Parameter DomainName. Setting op...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_NLB.DSC.ps1
MEMBER_NLB.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_NLB .Desription Builds a Network Load Balancing cluster node. .Parameters: DomainName = "LABBUILDER.COM" DomainAdminPassword = ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_FILESERVER.DSC.ps1
MEMBER_FILESERVER.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_FILESERVER .Desription Builds a Server that is joined to a domain and then made into a File Server. .Parameters: DomainNam...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/DC_FORESTCHILDDOMAIN.DSC.ps1
DC_FORESTCHILDDOMAIN.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title DC_FORESTCHILDDOMAIN .Desription Builds a Domain Controller and creates it as the first DC in a new child domain within the existing forest ...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DHCP.DSC.ps1
MEMBER_DHCP.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DHCP .Desription Builds a Server that is joined to a domain and then made into a DHCP Server. .Parameters: DomainName = "LABBUILDER....
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DHCPDNS.DSC.ps1
MEMBER_DHCPDNS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DHCPDNS .Desription Builds a Server that is joined to a domain and then made into a DHCP Server and DNS Server. .Parameters: DomainN...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/RODC_SECONDARY.DSC.ps1
RODC_SECONDARY.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title RODC_SECONDARY .Desription Builds a Read Only Domain Controller and adds it to the existing domain provided in the Parameter DomainName. The...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_IPAM.DSC.ps1
MEMBER_IPAM.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_IPAM .Desription Builds a Server that is joined to a domain and then made into an IPAM Server. .Parameters: DomainName = "LABBUILDER...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_NANO.DSC.ps1
MEMBER_NANO.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_NANO .Desription Builds a Nano Server and joins it to a Domain using an ODJ Request File. .Parameters: DomainName = "LABBUILDER.COM"...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_SQLSERVER2016.DSC.ps1
MEMBER_SQLSERVER2016.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_SQLSERVER2016 .Desription Builds a Server that is joined to a domain and then installs SQL Server 2016. It will install SQLServer fro...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_ADRMS.DSC.ps1
MEMBER_ADRMS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_ADRMS .Desription Builds a Server that is joined to a domain and then made into an ADRMS Server. .Parameters: DomainName = "LABBUILD...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_REMOTEACCESS_WAP.DSC.ps1
MEMBER_REMOTEACCESS_WAP.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_REMOTEACCESS_WAP .Desription Builds a Server that is joined to a domain and then contains Remote Access and Web Application Proxy com...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/MEMBER_DHCPNPAS.DSC.ps1
MEMBER_DHCPNPAS.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title MEMBER_DHCPNPAS .Desription Builds a Server that is joined to a domain and then made into a DHCP Server. NPAS is also installed. .Notes NPA...
PowerShellCorpus/PowerShellGallery/LabBuilder/0.8.3.1116/dsclibrary/STANDALONE_ROOTCA.DSC.ps1
STANDALONE_ROOTCA.DSC.ps1
<################################################################################################### DSC Template Configuration File For use by LabBuilder .Title STANDALONE_ROOTCA .Desription Builds a Standalone Root CA and creates Issuing CA certificates for Sub CAs. .Parameters: CACommonNam...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Resolve-XmlExNamespace.ps1
Resolve-XmlExNamespace.ps1
function Resolve-XmlExNamespace { <# .SYNOPSIS Resolves supplied prefix/namespace from the XmlEx namespace manager. .DESCRIPTION The Resolve-XmlExNamespace method resolves any defined Xml namespaces. #> [CmdletBinding()] [OutputType([System.Management.Automation.PSCustomObject])]...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Add-XmlExElement.ps1
Add-XmlExElement.ps1
function Add-XmlExElement { <# .SYNOPSIS Creates a new XmlEx document element. #> [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlElement')] [OutputType([System.Xml.XmlElement])] param ( ## Xml element name to add [Parameter(Mandatory, ValueFromPipelin...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Add-XmlExAttribute.ps1
Add-XmlExAttribute.ps1
function Add-XmlExAttribute { [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlAttribute')] [OutputType([System.Xml.XmlAttribute])] param ( ## Xml attribute name to add [Parameter(Mandatory, Position = 0, ParameterSetName = 'XmlEx')] [Parameter(Mandatory, Posi...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Add-XmlExText.ps1
Add-XmlExText.ps1
function Add-XmlExText { <# .SYNOPSIS Adds #> [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlText')] [OutputType([System.Xml.XmlText])] param ( ## Xml text to add [Parameter(Mandatory, ValueFromPipeline, Position = 0, ParameterSetName = 'XmlEx')] ...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/New-XmlExDocument.ps1
New-XmlExDocument.ps1
function New-XmlExDocument { <# .SYNOPSIS Creates a new XmlEx document. .DESCRIPTION The XmlDocument cmdlet #> [CmdletBinding()] [Alias('XmlDocument')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] [OutputT...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Add-XmlExNamespace.ps1
Add-XmlExNamespace.ps1
function Add-XmlExNamespace { <# .SYNOPSIS Creates a new XmlEx document namespace. #> [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlNamespace')] param ( ## Xml namespace prefix [Parameter(ValueFromPipelineByPropertyName, Position = 0, ParameterSetName = '...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Format-XmlEx.ps1
Format-XmlEx.ps1
function Format-XmlEx { <# .SYNOPSIS Pretty prints a [System.Xml.XmlDocument] object .NOTES https://blogs.msdn.microsoft.com/powershell/2008/01/18/format-xml/ #> [CmdletBinding()] param ( ## Xml document to pretty print [Parameter(Mandatory, ValueFromPipeline, V...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Add-XmlExComment.ps1
Add-XmlExComment.ps1
function Add-XmlExComment { <# .SYNOPSIS Creates a new XmlEx text node. #> [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlComment')] [OutputType([System.Xml.XmlComment])] param ( ## Comment to insert into the Xml document [Parameter(Mandatory, ValueFr...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Src/Set-XmlExDeclaration.ps1
Set-XmlExDeclaration.ps1
function Set-XmlExDeclaration { <# .SYNOPSIS Creates a new XmlEx document namespace. #> [CmdletBinding(DefaultParameterSetName = 'XmlEx')] [Alias('XmlDeclaration')] [OutputType([System.Xml.XmlDeclaration])] param ( ## Xml namespace prefix [Parameter(ValueFromPipelin...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Examples/Example01.ps1
Example01.ps1
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingCmdletAliases', '')] param() Import-Module -Name XmlEx -Force; $x = XmlDocument { XmlDeclaration -Encoding 'utf-8' XmlNamespace -Uri 'http://www.w3.org/XML/1998/namespace' XmlNamespace -Prefix 'v' -Uri 'http://mycustom/namespac...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Examples/Example04.ps1
Example04.ps1
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingCmdletAliases', '')] param() Import-Module -Name XmlEx -Force; $x = XmlDocument { XmlDeclaration -Encoding 'utf-8' -Standalone 'yes' XmlElement 'rootElement' } ## Appending an XmlElement to an exising root XmlElement. This is re...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Examples/Example03.ps1
Example03.ps1
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingCmdletAliases', '')] param() Import-Module -Name XmlEx -Force; $x = XmlDocument { XmlDeclaration } ## Appending an XmlElement to an exising XmlDocument XmlElement -XmlDocument $x -Name 'rootElement' { XmlElement 'TextNode' { ...
PowerShellCorpus/PowerShellGallery/XmlEx/0.9.1/Examples/Example02.ps1
Example02.ps1
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingCmdletAliases', '')] param() Import-Module -Name XmlEx -Force; $x = [System.Xml.XmlDocument] @' <?xml version="1.0" encoding="utf-8" standalone="yes"?> <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Get-DbData.ps1
Get-DbData.ps1
<# .SYNOPSIS Execute a command against a SQL Server instance. .DESCRIPTION Executes a command with output sent to the Verbose stream. Commands can be non-queries, scalars, or return rows (the default), data tables, or a data set. For data tables and dataset, if the command is a simple Select statement agains...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Get-DbSmo.ps1
Get-DbSmo.ps1
<# .SYNOPSIS Creates an SQL Server SMO Server object for a database engine instance. .DESCRIPTION While it's easy to instantiate a connection to SQL Server SMO it has a few bugs that require extra workarounds. * It doesn't provide a simple interface to set a timeout. * It has a bug which prevent DefaultInit...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/New-DbCommand.ps1
New-DbCommand.ps1
<# .SYNOPSIS Create an SQL command. .DESCRIPTION Creates an SQL command safely. This combines: * A connection string or connection object. * A command. * Parameters specified as a hash table. * Query timeouts. * An existing transaction. .PARAMETER Connection Connection string or SqlConnection. .PARA...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Enter-DbTransaction.ps1
Enter-DbTransaction.ps1
<# .SYNOPSIS Enter a SQL Transaction. .DESCRIPTION Enter a SQL Transaction. .PARAMETER InputObject A SqlCommand with a SqlConnection, or the output of Get-DbData. .PARAMETER TransactionName An optional name for the transaction. .PARAMETER PassThru Pass the transaction on in the pipeline for further ...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/New-DbBulkCopy.ps1
New-DbBulkCopy.ps1
<# .SYNOPSIS Efficiently bulk loads data into a SQL Server table. .DESCRIPTION Bulk loads data. Input columns do not need to be in the same order as the destination table as mapping is done. .PARAMETER InputObject A connection string, SqlConnection, SqlCommand, or SqlTransaction. .PARAMETER Data A DataS...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/New-DbConnection.ps1
New-DbConnection.ps1
<# .SYNOPSIS Create a SQL Server connection or connection string. .DESCRIPTION This is a safe way of building a connection string without joining them together manually. .PARAMETER DataSource Server name and instance. .PARAMETER InitialCatalog Database name. If not specified the login's default database...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Exit-DbTransaction.ps1
Exit-DbTransaction.ps1
<# .SYNOPSIS Exit a SQL transaction. .DESCRIPTION Commit or rollback a SQL transaction. .PARAMETER InputObject A SqlCommand with a SqlConnection and SqlTransaction. This can be extracted from a DataTable or a DataSet, but not a DataRow. .PARAMETER Commit Commit the transaction. .PARAMETER Rollback R...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Use-DbRetry.ps1
Use-DbRetry.ps1
<# .SYNOPSIS Retry SQL operations. .DESCRIPTION Retry SQL operations. These are only in limited scenarios: * SQL Server deadlocks and timeouts. * SQL Server policy evaluation errors (caused by race conditions). .PARAMETER ScriptBlock The script you want to execute. It's best to keep this as short as possi...
PowerShellCorpus/PowerShellGallery/DbData/1.4.0.3/Get-DbWmi.ps1
Get-DbWmi.ps1
<# .SYNOPSIS Creates a SQL Server SMO ManagedComputer object for a server. .DESCRIPTION Essentially a shortcut for a long object name. These objects can be used to inspect SQL Server related services and their settings. .PARAMETER ComputerName A computer name. .INPUTS A computer name. .OUTPUTS A Man...
PowerShellCorpus/PowerShellGallery/cCouchPotato/1.0/Examples/cCouchPotatoInstall.ps1
cCouchPotatoInstall.ps1
configuration DownloadHostDSC { Import-DscResource -ModuleName 'cCouchPotato' cCouchPotatoInstall CouchPotatoInstaller { Ensure = 'Present' } }
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/read-ini.ps1
read-ini.ps1
# reconstitute a Hashtable from INI file and read a value $content = Get-IniContent .\settings.ini $content["category2"]["key4"]
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/uncomment-ini.ps1
uncomment-ini.ps1
# reconstitute a Hashtable from INI file and read a value $category1=@{"key1"="value1";"key2"="value2"} $category2=@{"key3"="value3";"Comment1"=";key4=value4"} $content=@{"category1"=$category1;"category2"=$category2} out-inifile -inputobject $content -filepath .\settings.ini -force Write-Host("content[categor...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/update-ini.ps1
update-ini.ps1
# reconstitute a Hashtable from INI file and read a value $content = Get-IniContent .\settings.ini | Set-IniContent -Sections 'category2' -NameValuePairs 'key4=newvalue4' $content["category2"]["key4"]
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/save-ini.ps1
save-ini.ps1
# create an INI file with values from Hashtable $category1=@{"key1"="value1";"key2"="value2"} $category2=@{"key3"="value3";"key4"="value4"} $content=@{"category1"=$category1;"category2"=$category2} out-inifile -inputobject $content -filepath .\settings.ini
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/remove-ini.ps1
remove-ini.ps1
# reconstitute a Hashtable from INI file and read a value $content = Get-IniContent .\settings.ini | Remove-IniEntry -Sections 'category2' -Keys 'key4' if (!$content["category2"]["key4"]) { Write-Host "content[category2][key4] no longer exists." }
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Examples/comment-ini.ps1
comment-ini.ps1
# reconstitute a Hashtable from INI file and read a value $content = Get-IniContent .\settings.ini | Add-IniComment -Sections 'category2' -Keys 'key4' $content["category2"]["Comment1"]
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Remove-IniComment.ps1
Remove-IniComment.ps1
Set-StrictMode -Version Latest Function Remove-IniComment { <# .Synopsis Uncomments out specified content of an INI file .Description Uncomments out specified keys in all sections or certain sections. The ini source can be specified by a file or piped in by the result of Get-IniCont...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Add-IniComment.ps1
Add-IniComment.ps1
Set-StrictMode -Version Latest Function Add-IniComment { <# .Synopsis Comments out specified content of an INI file .Description Comments out specified keys in all sections or certain sections. The ini source can be specified by a file or piped in by the result of Get-IniContent. ...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Remove-IniEntry.ps1
Remove-IniEntry.ps1
Set-StrictMode -Version Latest Function Remove-IniEntry { <# .Synopsis Removes specified content from an INI file .Description Removes specified keys in all sections or certain sections. The ini source can be specified by a file or piped in by the result of Get-IniContent. T...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Convert-IniEntryToComment.ps1
Convert-IniEntryToComment.ps1
# Internal module function to remove the old key then insert a new one at the old location in the comment style used by Get-IniContent. Function Convert-IniEntryToComment { param ($content, $key, $section, $commentChar) # Comments in Get-IniContent start with 1, not zero. $commentCount = 1 foreach ($e...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Out-IniFile.ps1
Out-IniFile.ps1
Set-StrictMode -Version Latest Function Out-IniFile { <# .Synopsis Write hash content to INI file .Description Write hash content to INI file .Notes Author : Oliver Lipkau <oliver@lipkau.net> Blog : http://oliver.lipkau.net/blog/ Source : https:...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Set-IniContent.ps1
Set-IniContent.ps1
Set-StrictMode -Version Latest Function Set-IniContent { <# .Synopsis Updates existing values or adds new key-value pairs to an INI file .Description Updates specified keys to new values in all sections or certain sections. Used to add new or change existing values. To comment, unco...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Convert-IniCommentToEntry.ps1
Convert-IniCommentToEntry.ps1
# Internal module function to remove the old comment then insert a new key/value pair at the old location with the previous comment's value. Function Convert-IniCommentToEntry { param ($content, $key, $section, $commentChar) $index = 0 $commentFound = $false $commentRegex = "^([$($commentChar -join ''...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Functions/Get-IniContent.ps1
Get-IniContent.ps1
Set-StrictMode -Version Latest Function Get-IniContent { <# .Synopsis Gets the content of an INI file .Description Gets the content of an INI file and returns it as a hashtable .Notes Author : Oliver Lipkau <oliver@lipkau.net> Source : https://github.com/lipkau/PsIni ...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Get-IniContent.Tests.ps1
Get-IniContent.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adjusting ...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Remove-IniEntry.Tests.ps1
Remove-IniEntry.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adju...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Out-IniFile.Tests.ps1
Out-IniFile.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -Parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adjusting ...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/PsIni.Tests.ps1
PsIni.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -Parent Set-Location $ScriptDir $manifestPath = "$ScriptDir\..\PsIni.psd1" Describe -Tags 'VersionChecks' "PsIni manifest" { $script:manifest = $null It "has a valid man...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Remove-IniComment.Tests.ps1
Remove-IniComment.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adju...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Set-IniContent.Tests.ps1
Set-IniContent.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adju...
PowerShellCorpus/PowerShellGallery/PsIni/1.2.0/Tests/Add-IniComment.Tests.ps1
Add-IniComment.Tests.ps1
# Enforce WorkingDir #-------------------------------------------------- $Script:ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -parent Set-Location $ScriptDir $testFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") # functions and tests stored in separate directories; adju...
PowerShellCorpus/PowerShellGallery/AutoBrowse/1.0/Test-BrowserLocation.ps1
Test-BrowserLocation.ps1
function Test-BrowserLocation { <# .Synopsis Tests if the browser is at a specific page. .Description Tests if the browser is at a specific URL or page name. .Example Open-Browser -Url http://start-automating.com | Test-BrowserLocation -Name Start-Automating...