full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWordPress/DscResources/MSFT_xWordPressSite/xWordPressSite.ps1 | xWordPressSite.ps1 | # Sample script to create the template or update the Wordpress Resource
# Resource Details
# Friendly name of the resource:
$friendlyName = "xWordPressSite"
# Name of the resource:
$resourceName = "MSFT_$friendlyName"
# Class Version of the resource:
$classVersion = "1.0.0"
# Various Paths
$diff = join-... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWordPress/samples/WordPressConfigurationTemplate.ps1 | WordPressConfigurationTemplate.ps1 | # Generate a WordPress configuration base on the supplied parameters
# and returns it as a string.
param
(
[Parameter(Mandatory = $true)]
[string] $WordPressDatabase,
[Parameter(Mandatory = $true)]
[string] $WordPressUserName,
[Parameter(Mandatory = $true)]
[... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWordPress/samples/InstallRequiredModules.ps1 | InstallRequiredModules.ps1 | # This Script installs the required modules for the WordPress Sample
# It uses the PowerShell Resource Gallery, see https://msconfiggallery.cloudapp.net/
# This requires WMF 5. If you don't have WMF 5, Please install the modules manually.
Write-Host "Installing required modules..."
Install-Module xWebAdministrat... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWordPress/samples/SingleNodeEndToEndWordPress.ps1 | SingleNodeEndToEndWordPress.ps1 | # This configuration configures a Basic WordPress Site
# It requires xPhp, xMySql, xWordPress, and xWebAdministration
# Please review the note about the FQDN variable and
# about the URLs, they may need to be updated.
# ********* NOTE ***********
# If you are not targetting the local machine,
# or this does no... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWindowsRestore/Examples/ConfigureSystemRestore.ps1 | ConfigureSystemRestore.ps1 | #---------------------------------------------------------------------------------
#The sample scripts are not supported under any Microsoft standard support
#program or service. The sample scripts are provided AS IS without warranty
#of any kind. Microsoft further disclaims all implied warranties including,
#wit... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWindowsRestore/Examples/CreateSystemRestorePoint.ps1 | CreateSystemRestorePoint.ps1 | #---------------------------------------------------------------------------------
#The sample scripts are not supported under any Microsoft standard support
#program or service. The sample scripts are provided AS IS without warranty
#of any kind. Microsoft further disclaims all implied warranties including,
#wit... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xTimeZone/Example/SetTimeZone.ps1 | SetTimeZone.ps1 | #---------------------------------------------------------------------------------
#The sample scripts are not supported under any Microsoft standard support
#program or service. The sample scripts are provided AS IS without warranty
#of any kind. Microsoft further disclaims all implied warranties including,
#wit... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWebAdministration/Examples/Sample_xWebsite_NewWebsiteFromConfigurationData.ps1 | Sample_xWebsite_NewWebsiteFromConfigurationData.ps1 | Configuration Sample_xWebsite_FromConfigurationData
{
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
# Dynamically find the applicable nodes from configuration data
Node $AllNodes.where{$_.Role -eq "Web"}.NodeName
{
# Install the IIS ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWebAdministration/Examples/Sample_xWebsite_NewWebsite.ps1 | Sample_xWebsite_NewWebsite.ps1 | configuration Sample_xWebsite_NewWebsite
{
param
(
# Target nodes to apply the configuration
[string[]]$NodeName = 'localhost',
# Name of the website to create
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[String]$WebSiteName,
# Source P... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWebAdministration/Examples/Sample_xWebsite_RemoveDefault.ps1 | Sample_xWebsite_RemoveDefault.ps1 | configuration Sample_xWebsite_StopDefault
{
param
(
# Target nodes to apply the configuration
[string[]]$NodeName = 'localhost'
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
Node $NodeName
{
# Install ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xSqlPs/Samples/sql101.ps1 | sql101.ps1 | # Configuration to install Sql server database engine and management tools.
#
# A. Prepare a local self signed certificate with the following steps:
# 1. Get MakeCert.exe if you don't have. ( MakeCert.exe is shipped with windows SDK: http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx)
# 2. Open console ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWindowsUpdate/Examples/Sample_xWindowsUpdateFromPath.ps1 | Sample_xWindowsUpdateFromPath.ps1 | <#
# This sample looks at installing a particular windows update. However, the path and ID properties can be changed
# as per the hotfix that you want to install
#>
Configuration DownloadHotfixFromPath
{
xHotfix m1
{
Path = "c:\WindowsBlue-KB2937982-x64.msu"
Id = "KB2937982"
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xWindowsUpdate/Examples/Sample_xWindowsUpdateFromURI.ps1 | Sample_xWindowsUpdateFromURI.ps1 | <#
# This sample looks at installing a particular windows update. However, the URI and ID properties can be changed
# as per the hotfix that you want to install
#>
Configuration DownloadHotfixFromURI
{
xHotfix m1
{
Uri = "http://hotfixv4.microsoft.com/Microsoft%20Office%20SharePoint%20Serv... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xIPAddress_FixedValue.ps1 | Sample_xIPAddress_FixedValue.ps1 | configuration Sample_xIPAddress_FixedValue
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DscResource -Module xNetworking
Node $NodeName
{
xIPAddress NewIPAddress
{
IPAddress = "2001:4898:200:7:6c71:a102:ebd8:f482"
Interf... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xDnsServerAddress.ps1 | Sample_xDnsServerAddress.ps1 | configuration Sample_xDnsServerAddress
{
param
(
[string[]]$NodeName = 'localhost',
[Parameter(Mandatory)]
[string]$DnsServerAddress,
[Parameter(Mandatory)]
[string]$InterfaceAlias,
[ValidateSet("IPv4","IPv6")]
[string]$AddressFamily = 'IPv... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xFirewall_DisableAccessToApplication.ps1 | Sample_xFirewall_DisableAccessToApplication.ps1 | # DSC configuration for Firewall
#
configuration Sample_xFirewall_AddFirewallRuleToNewGroup
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xNetworking
Node $NodeName
{
xFirewall Firewall
{
Name ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xFirewall_AddFirewallRule.ps1 | Sample_xFirewall_AddFirewallRule.ps1 | # DSC configuration for Firewall
configuration Sample_xFirewall_AddFirewallRule
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xNetworking
Node $NodeName
{
xFirewall Firewall
{
Name = "NotePadFi... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xIPAddress_Parameterized.ps1 | Sample_xIPAddress_Parameterized.ps1 | configuration Sample_xIPAddress_Parameterized
{
param
(
[string[]]$NodeName = 'localhost',
[Parameter(Mandatory)]
[string]$IPAddress,
[Parameter(Mandatory)]
[string]$InterfaceAlias,
[Parameter(Mandatory)]
[string]$DefaultGateway,
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xFirewall_AddFirewallRuleToExistingGroup.ps1 | Sample_xFirewall_AddFirewallRuleToExistingGroup.ps1 | # DSC configuration for Firewall
#
configuration Sample_xFirewall_AddFirewallRuleToExistingGroup
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xNetworking
Node $NodeName
{
xFirewall Firewall
{
Name ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xNetworking/Examples/Sample_xFirewall_AddFirewallRuleToNewGroup.ps1 | Sample_xFirewall_AddFirewallRuleToNewGroup.ps1 | # DSC configuration for Firewall
configuration Sample_xFirewall_AddFirewallRuleToNewGroup
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xNetworking
Node $NodeName
{
xFirewall Firewall
{
Name = ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xSQLServer/Examples/SQL-ClusterDB.ps1 | SQL-ClusterDB.ps1 | #requires -Version 5
Configuration SQL
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xFailoverCluster
Node $AllNodes.NodeName
{
# Set LCM to reboot if needed
LocalConfigurationManager
{
DebugMode = $true
RebootNodeIfNeed... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/Reskit9/All Resources/xSQLServer/Examples/SQL-Standalone.ps1 | SQL-Standalone.ps1 | #requires -Version 5
Configuration SQLSA
{
Import-DscResource -Module xSQLServer
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_ -eq $Role}}.NodeName)
Set... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod3/Config_Feature.ps1 | Config_Feature.ps1 | Configuration Demo_Feature {
Import-DSCResource -ModuleName MVADemo
Node s1 {
MVAFeature Backup {
FeatureName= 'windows-server-backup'
Installed= $True
Ensure = 'Present'
}
}
}
Demo_Feature
Start-DscConfiguration -Path .\Demo... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod3/LCM_HTTPPull.ps1 | LCM_HTTPPull.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName {
Settings{
AllowModuleOverwr... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod3/Config_Service.ps1 | Config_Service.ps1 | Configuration Demo_Service {
Import-DSCResource -ModuleName MVADemo
Node s2 {
MVAService Bits {
ServiceName = 'bits'
Servicestatus = 'running'
Ensure = 'Present'
}
}
}
Demo_Service -OutputPath C:\Scripts\DSC2\Mod3\Config
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod3/_M3_demo.ps1 | _M3_demo.ps1 | # 1. Push Deployment
Copy-item -Path C:\Scripts\DSC2\mod3\MVADemo -Destination 'C:\Program Files\WindowsPowerShell\Modules\MVADemo' -Recurse -Force
explorer 'C:\Program Files\WindowsPowerShell\Modules'
Get-DscResource
# 2. Pull server
# Show module version in .psd1
ise C:\Scripts\dsc2\Mod3\MVADemo\MVADemo.p... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/WebServerConfig.ps1 | WebServerConfig.ps1 | Configuration WebServer {
Node s3 {
WindowsFeature web {
Name = 'web-server'
Ensure = 'Present'
}
}
}
webserver -outputpath c:\config
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/Config_NLB.ps1 | Config_NLB.ps1 | Configuration NLB {
Node s3 {
WindowsFeature NEwNLB {
Name='NLB'
Ensure = 'Present'
}
}
}
NLB -outputpath C:\DSCSMB
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/_M7-Demo.ps1 | _M7-Demo.ps1 |
# 1. Composite resource structure
ise C:\Scripts\DSC2\Mod7\LCM_Partial_Notes.ps1
ise C:\Scripts\DSC2\Mod7\LCM_Partial_Notes2.ps1
# Actual LCM Config
ise C:\Scripts\DSC2\Mod7\LCM_Partial.ps1
# Set the LCM
# Should remove configs Remove-DSCConfigurationDocuments
Set-DscLocalConfigurationManager -Path C:\Scripts\... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/LCM_Partial_Notes2.ps1 | LCM_Partial_Notes2.ps1 | [DSCLocalConfigurationManager()]
configuration SQLServerDSCSettings
{
Node localhost
{
Settings
{
ConfigurationModeFrequencyMins = 30
}
ConfigurationRepositoryWeb OSConfigServer
{
ServerURL = "https://corp.contoso.com/OSConfigServe... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/LCM_Partial.ps1 | LCM_Partial.ps1 | [DscLocalConfigurationManager()]
Configuration partialMeta
{
Node s3 {
Settings
{
RefreshMode = "Pull"
RefreshFrequencyMins = 30
ConfigurationModeFrequencyMins = 15
ConfigurationMode = "ApplyAndAutoCorrect"
RebootNodeIfNeeded = $True
Configu... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod7/LCM_Partial_Notes.ps1 | LCM_Partial_Notes.ps1 | [DscLocalConfigurationManager()]
Configuration partialMeta
{
Settings
{
RefreshMode = "PULL"
RefreshFrequencyMins = 30
ConfigurationModeFrequencyMins = 15
ConfigurationMode = "ApplyAndAutoCorrect"
RebootNodeIfNeeded = $false
ConfigurationId = "922A3987-... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/ClassStructureSimple.ps1 | ClassStructureSimple.ps1 | # From release notes
enum Ensure
{
Absent
Present
}
[DscResource()]
class FileResource
{
[DscProperty(Key)]
[string]$Path
[DscProperty(Mandatory)]
[Ensure] $Ensure
[DscProperty(Mandatory)]
[string] $SourcePath
[DscProperty(NotConfigurable)]
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/test.ps1 | test.ps1 | enum Ensure {
Absent
Present
}
[DscResource()]
class ClassService {
[DscProperty(Key)]
[string]$serviceName
[DscProperty(Mandatory)]
[Ensure] $Ensure
[DscProperty(Mandatory)]
[string] $Servicestatus
[ClassService] Get() {
$serviceExists = Get-Serv... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/config_class.ps1 | config_class.ps1 | Configuration Demo_Class {
Import-DSCResource -ModuleName MVAClassService
Node dc {
ClassService bits {
Servicename = 'bits'
Servicestatus = 'Running'
Ensure = 'Present'
}
}
}
Demo_class
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/_M4-Demo.ps1 | _M4-Demo.ps1 |
# 1. Custom resource structure using classes
# use for example and explain
ise C:\Scripts\DSC2\Mod4\ClassStructure.ps1
ise C:\Scripts\DSC2\Mod4\ClassStructureSimple.ps1
ise C:\Scripts\dsc2\Mod4\ClassManifeststructure.ps1
# 2. Create a class-defined custom resource
ise C:\Scripts\DSC2\Mod4\Class\MVAClassSe... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/ClassStructure.ps1 | ClassStructure.ps1 | # From release notes
enum Ensure
{
Absent
Present
}
<#
This resource manages the file in a specific path.
[DscResource()] indicates the class is a DSC resource
#>
[DscResource()]
class FileResource
{
<#
This property is the fully qualified path to the file that is
e... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/LCM_Class.ps1 | LCM_Class.ps1 | [DSCLocalConfigurationManager()]
Configuration Debugmode
{
Node dc
{
Settings
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
Debugmode = 'All'
}
}
}
DebugMode -OutputPath C:\scripts\dsc2\Mod4
# Send to computer... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod4/ClassManifeststructure.ps1 | ClassManifeststructure.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'MyDscResource.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = '81624038-5e71-40f8-8905-b1a87afe22d7'
# Author of this module
Author = 'User01'
# Company... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod1/_M1-Demo.ps1 | _M1-Demo.ps1 | # 1. DSC custom resource architecture overview
# 3 Show the three files, then copy to bad location just to show
# that the custom resource works. Then delete.
ise C:\Scripts\DSC2\Mod1\MVAService\MVAService.schema.mof
ise C:\Scripts\dsc2\mod1\MVAService\MVAService.psm1
ise C:\Scripts\DSC2\Mod1\MVAService\MVASer... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod5/4.Config_Feature.ps1 | 4.Config_Feature.ps1 | Configuration Demo_Feature {
Import-DSCResource -ModuleName MVADemo
Node s1 {
MVAFeature Backup {
FeatureName= 'web-server'
Installed= $False
Ensure = 'Present'
}
}
}
Demo_Feature -outputpath C:\Scripts\DSC2\mod5\config
Start... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod5/3.LCM_Reboot.ps1 | 3.LCM_Reboot.ps1 | Configuration LCM_Reboot
{
Node s1
{
localconfigurationmanager
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
Debugmode = 'All'
RebootNodeIfNeeded = $True
}
}
}
LCM_Reboot -OutputPath C:\scripts\dsc2\M... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod5/_M5-Demo.ps1 | _M5-Demo.ps1 |
# 1. Adding verbose and debug messages
ise C:\Scripts\DSC2\Mod5\1.MVAServiceverbose.psm1
# Add the following code to Test-Target - this has error checking and verbose
ise C:\scripts\DSC2\Mod5\2.Verbosetestcode.ps1
# 2. Adding help content
ise C:\Scripts\DSC2\Mod5\about_MVADemo.help.txt
# Create folder in ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod5/2.Verbosetestcode.ps1 | 2.Verbosetestcode.ps1 | [CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([System.Boolean])]
param
(
#[parameter(Mandatory = $true)]
[System.String]
$ServiceName='bitsss',
[ValidateSet("Running","Stopped")]
[System.String]
$Servicestatus='running',
[ValidateSet("Present","Absent")]
[System.String]
$E... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod2/_M2_Demo.ps1 | _M2_Demo.ps1 | # Designing info URLs
Start-Process -FilePath iexplore http://blogs.msdn.com/b/powershell/archive/2014/11/18/powershell-dsc-resource-design-and-testing-checklist.aspx
Start-Process -FilePath http://blogs.msdn.com/b/powershell/archive/2014/11/19/documenting-dsc-part-2.aspx
Start-Process -FilePath http://www.microsoft... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod6/_M6-Demo.ps1 | _M6-Demo.ps1 |
# 1. Composite resource structure
ise C:\Scripts\DSC2\Mod6\Config_composite.psm1
# Save as Baseconfig.schema.psm1 in folder structure
copy-item C:\scripts\dsc2\mod6\Config_composite.psm1 -Destination C:\scripts\DSC2\Mod6\BaseConfig.schema.psm1 -force
#Create new folder and copy composite resource
New-Item -Path ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod6/WebConfig.ps1 | WebConfig.ps1 | Configuration WebServer {
Import-DscResource -ModuleName CompositeDSC
Node s1 {
baseconfig Base {
servicename = 'audiosrv'
}
WindowsFeature web {
Name = 'web-server'
Ensure = 'Present'
}
}
}
webserver -out... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC2/Mod6/LCM_setup.ps1 | LCM_setup.ps1 | Configuration LCM_Reboot
{
Node s1
{
localconfigurationmanager
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
Debugmode = 'All'
RebootNodeIfNeeded = $True
}
}
}
LCM_Reboot -OutputPath C:\scripts\dsc2\M... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod3/0.Config_SMBPullServer.ps1 | 0.Config_SMBPullServer.ps1 |
# Create folder and share on DC for MOF and Resource modules
New-Item -Path C:\DSCSMB -ItemType Directory
New-SmbShare -Name DSCSMB -Path c:\DSCSMB -ReadAccess Everyone -FullAccess Administrator -Description "SMB share for DSC" |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod3/_M3-Demo.ps1 | _M3-Demo.ps1 |
# 1.Configuring SMB Pull Server - NO TARGET LCM Till next module
# Create folder and share on DC for MOF and Resource modules
New-Item -Path C:\DSCSMB -ItemType Directory
New-SmbShare -Name DSCSMB -Path c:\DSCSMB -ReadAccess Everyone -FullAccess Administrator -Description "SMB share for DSC"
# 2. Configurin... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod3/2.Config_HTTPSPullServer.ps1 | 2.Config_HTTPSPullServer.ps1 | configuration HTTPSPullServer
{
# Modules must exist on target pull server
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node s4
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
WindowsFe... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod3/1.Config_HTTPPullServer.ps1 | 1.Config_HTTPPullServer.ps1 | configuration HTTPPullServer
{
# Modules must exist on target pull server
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node dc
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
WindowsFea... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod7/_M7-Demo.ps1 | _M7-Demo.ps1 |
# NX is hostname, 192.168.3.20
# Copy Resource module and show.
Copy-item -Path C:\Scripts\DSC1\Mod7\nx -Destination C:\Windows\System32\WindowsPowerShell\v1.0\Modules -Recurse -Force
Get-DscResource
# Get pre-req and build OMI Server
Start-Process -FilePath iexplore http://blogs.technet.com/b/privatecloud... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod7/WordPressConfig.ps1 | WordPressConfig.ps1 | $OFS=[Environment]::Newline
#Read Script elements from text files
$ConfigGet = Get-Content "c:\scripts\DSC1\Mod7\scripts\get.txt"
$ConfigSet = Get-Content "c:\scripts\DSC1\Mod7\scripts\set.txt"
$ConfigTest = Get-Content "c:\scripts\DSC1\Mod7\scripts\test.txt"
#Get WPConfig from file
$WPConfig = Get-Content... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod7/ResetDSCDemo.ps1 | ResetDSCDemo.ps1 | $OFS=[Environment]::Newline
#Read Script elements from text files
$Get = Get-Content ".\reset\resetget.txt"
$Set = Get-Content ".\reset\resetset.txt"
$Test = Get-Content ".\reset\resettest.txt"
#Get WPConfig from file
$WPConfig = Get-Content ".\scripts\WP-Config.txt"
#Define WordPress Server Configuration... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod7/WPDemoApply.ps1 | WPDemoApply.ps1 | $securePass=ConvertTo-SecureString -string "P@ssw0rd" -AsPlainText -Force
$cred= New-Object System.Management.Automation.PSCredential "root", $SecurePass
$opt = New-CimSessionOption -UseSsl:$true -SkipCACheck:$true -SkipCNCheck:$true -SkipRevocationCheck:$true
$demo1=New-CimSession -Credential:$cred -ComputerNam... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod7/_NX_OMI.ps1 | _NX_OMI.ps1 | Start-Process -FilePath iexplore http://blogs.technet.com/b/privatecloud/archive/2014/05/19/powershell-dsc-for-linux-step-by-step.aspx
# Do not run in Windows PowerShell -- CentOS 6
# 1. Install required Pre-Req packages
yum groupinstall 'Development Tools'
yum install pam-devel
yum install openssl-devel
yum ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/_IntroDemo/_M0-Demo.ps1 | _M0-Demo.ps1 | # Just after introduction
# Quick Demo - Don't code - just show the idea - setting a service state.
ise C:\Scripts\dsc1\_IntroDemo\Fast_Config_Demo.ps1
ise C:\Scripts\DSC1\_IntroDemo\s3.mof
# Verify service is stopped and send new config
Get-service -name bits -ComputerName s3
Start-DscConfiguration -Path C:\Sc... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/_IntroDemo/Fast_Config_Demo.ps1 | Fast_Config_Demo.ps1 | Configuration SetBits {
Node s3 {
Service bits {
Name='bits'
State='running'
}
}
}
Setbits -outputpath C:\Scripts\DSC1\Mod1
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/5.LCM_HTTPSPull.oldStyle.ps1 | 5.LCM_HTTPSPull.oldStyle.ps1 | Configuration LCM_HTTPSPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName
{
LocalConfigurationManager
{
AllowModuleOverwrite = $True
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/2.Config_Backup.ps1 | 2.Config_Backup.ps1 | configuration Backup {
Node SMBComputers {
WindowsFeature Backup{
Name = 'Windows-Server-Backup'
Ensure = 'Present'
}
}
}
Backup -OutputPath C:\DSCSMB
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/_M4-Demo.ps1 | _M4-Demo.ps1 | # Demo for slides 2 and 3 of the module
# LCM for SMB pull configuration
Ise C:\Scripts\dsc1\Mod4\1.LCM_SMBPull.oldStyle.ps1
ise C:\Scripts\DSC1\Mod4\1.LCM_SMBPull.ps1 # Run
# Can show MOF
Explorer c:\DSCSMB
# Send to computers LCM
Set-DSCLocalConfigurationManager -ComputerName s1,s2 -Path c:\DSCSMB –Verbose... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/1.LCM_SMBPull.oldStyle.ps1 | 1.LCM_SMBPull.oldStyle.ps1 | Configuration LCM_SMBPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName
{
LocalConfigurationManager
{
AllowModuleOverwrite = $True
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/3.LCM_HTTPPull.ps1 | 3.LCM_HTTPPull.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName {
Settings{
AllowModuleOverwr... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/3.LCM_HTTPPull.oldStyle.ps1 | 3.LCM_HTTPPull.oldStyle.ps1 | Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName
{
LocalConfigurationManager
{
AllowModuleOverwrite = $True
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/4.Config_SMTP.ps1 | 4.Config_SMTP.ps1 | configuration SMTP {
Node HTTPComputers {
WindowsFeature SMTP{
Name = 'SMTP-Server'
Ensure = 'Present'
}
}
}
SMTP -OutputPath C:\DSC\HTTP
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/5.LCM_HTTPSPull.ps1 | 5.LCM_HTTPSPull.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_HTTPSPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName {
Settings {
AllowModuleOv... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/7.QueryNode.ps1 | 7.QueryNode.ps1 | function QueryNodeInformation
{
Param (
[string] $Uri = "http://dc.company.pri:9080/PSDSCComplianceServer.svc/Status",
[string] $ContentType = "application/json"
)
Write-Output "Querying node information from pull server URI = $Uri"
Write-Output "... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/1.LCM_SMBPull.ps1 | 1.LCM_SMBPull.ps1 | [DSCLocalconfigurationManager()]
Configuration LCM_SMBPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName
{
Settings {
AllowModuleOverwri... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod4/6.Config_RemoveSMTP.ps1 | 6.Config_RemoveSMTP.ps1 | configuration SMTP {
Node HTTPSComputers {
WindowsFeature SMTP{
Name = 'SMTP-Server'
Ensure = 'Absent'
}
}
}
SMTP -OutputPath C:\DSC\HTTPS
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod1/_M1-Demo.ps1 | _M1-Demo.ps1 |
# 1. Resources for DSC
# Show web location of Reskit - Show Reskit Zip
Find-Module -Name x* #(Also explain X and C)
Find-DSCResource
Find-Package # OneGet
# 2. Requirements for DSC
# show Remoting GPO - Computer Configuration/Policies/Administrative Templates/Windows Components/Windows Remote Management/W... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/1.LCM_Push.ps1 | 1.LCM_Push.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_Push
{
Node s1
{
Settings
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
}
}
}
LCM_Push -ComputerName s1 -OutputPath C:\DSC\Mod5Config
Set-DSCLocalCo... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/7.Config_Log.ps1 | 7.Config_Log.ps1 |
configuration TestLog {
Node s1 {
Log CreateLogEntry {
Message = 'This DSC config worked!'
}
}
}
TestLog -OutputPath c:\DSC\Mod5Config
Start-DscConfiguration -computername s1 -Path c:\dsc\Mod5Config -Wait -Verbose -force
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/3.Config_Archive.ps1 | 3.Config_Archive.ps1 |
configuration TestArchive {
Node s1 {
Archive Unzip{
Destination = 'C:\unzip'
Path = 'c:\downloads\unzip.zip'
Checksum = 'SHA-256'
Validate = $true
Force = $true
Ensure = 'Present'
}
}
}
TestArchive -Outp... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/11.Config_Script.ps1 | 11.Config_Script.ps1 |
configuration TestScript {
Node s1 {
Script TestScript {
GetScript = {
@{
GetScript = $GetScript
SetScript = $setScript
TestScript = $TestScript
Result = (Get-Service -name bits).status
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/2.Config_File.ps1 | 2.Config_File.ps1 |
configuration TestFile {
Node s1 {
File ZipFile {
Ensure = "Present"
Type = "Directory“ # Default is “File”
Force = $True
Recurse = $True
SourcePath = '\\dc\Downloads'
DestinationPath = 'C:\Downloads' # On S1
}... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/8.Config_WindowsProcess.ps1 | 8.Config_WindowsProcess.ps1 |
configuration TestProcess {
Node s1 {
WindowsProcess CreateNotepad {
Path = 'notepad.exe'
Arguments = ''
}
WindowsProcess CreatePaint {
Path = 'mspaint.exe'
Arguments = ''
}
}
}
TestProcess -OutputPath c:\DSC\Mo... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/10.Config_Registry.ps1 | 10.Config_Registry.ps1 |
configuration TestRegistry {
Node s1 {
Registry CreateReg {
Key = 'HKEY_Local_Machine\Software\DSCTest'
ValueName = 'DSCTestGood'
ValueType = 'string'
ValueData = 'True'
}
}
}
Testregistry -OutputPath c:\DSC\Mod5Config
Start-Dsc... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/6.Config_Group.ps1 | 6.Config_Group.ps1 |
configuration TestGroup {
Node s1 {
Group CreateGroup {
Ensure = 'Present'
GroupName = 'TestGroup'
Description = 'This is a DSC test group'
Members = 'testuser','administrator'
}
}
}
TestGroup -OutputPath c:\DSC\Mod5Confi... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/5.Config_User.ps1 | 5.Config_User.ps1 |
configuration TestUser {
Node s1 {
User CreateUser {
Ensure = "Present"
UserName= 'TestUser'
Description = 'This is a DSC test user'
Disabled = $False
PasswordChangeNotAllowed = $true
PasswordNeverExpires = $False
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/4.Config_EnvironmentVar.ps1 | 4.Config_EnvironmentVar.ps1 |
configuration TestEnvVar {
Node s1 {
Environment NewVar{
Name = 'MYNEWVAR'
Value = 'Value to store'
Ensure = 'Present'
}
}
}
TestEnvVar -OutputPath c:\DSC\Mod5Config
Start-DscConfiguration -computername s1 -Path c:\dsc\Mod5Config -Wait -Verbo... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/_M5-Demo.ps1 | _M5-Demo.ps1 | # 1. Built-in Resources
Get-DscResource -name File | Select-Object -ExpandProperty Properties
Get-DscResource -name File -Syntax
# Discuss adding resources locally
# discuss Adding resources to a pull server
# Set for Push
ise C:\Scripts\DSC1\Mod5\1.LCM_Push.ps1
# File
ise C:\Scripts\DSC1\Mod5\2.Config... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod5/9.Config_WindowsService.ps1 | 9.Config_WindowsService.ps1 |
configuration TestService {
Node s1 {
Service StartAudio {
Name = 'Audiosrv'
State = 'Running'
StartupType = 'Automatic'
}
}
}
TestService -OutputPath c:\DSC\Mod5Config
Start-DscConfiguration -computername s1 -Path c:\dsc\Mod5Config -Wait -Ver... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod2/_M2-Demo.ps1 | _M2-Demo.ps1 |
# 1.Writing a DSC Configuration
Configuration Name{
Node s3 {
WindowsFeature Demo{
}
}
}
# 2.Configuring the LCM
Get-Help *-DSC*
Get-Help *localConfig*
Get-DscLocalConfigurationManager -CimSession s1
# Describe basic settings - not too much right now
#Script to change LCM t... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod2/1.LCM_Push_NewWay.ps1 | 1.LCM_Push_NewWay.ps1 | [DSCLocalConfigurationManager()]
Configuration LCMPUSH
{
Node $Computername
{
SEttings
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
}
}
}
$Computername = 's1','s2'
# Create the Computer.Meta.Mof in folder
LCMPush -OutputPa... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod2/2.SimpleConfig.ps1 | 2.SimpleConfig.ps1 | configuration ConfigName {
Node $ComputerName {
WindowsFeature IIS{
Name = 'web-server'
Ensure = 'Present'
}
}
}
$computername = 'S1','S2'
ConfigName -OutputPath c:\DSC\Config
|
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod2/1.LCM_Push_Oldway.ps1 | 1.LCM_Push_Oldway.ps1 | Configuration LCMPUSH
{
Node $Computername
{
LocalConfigurationManager
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
}
}
}
$Computername = 's1','s2'
# Create the Computer.Meta.Mof in folder
LCMPush -OutputPath c:\DSC\LCM
... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/2b.Config_credential.ps1 | 2b.Config_credential.ps1 | Configuration DirTest {
param (
[pscredential]$credential
)
Node S1 {
File DirTest1 {
DestinationPath = 'c:\DirTest'
Type = 'Directory'
Ensure = 'Present'
Credential = $Credential
}
}
}
Dirtest -Credential (Get-Credenti... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/_M6-Demo.ps1 | _M6-Demo.ps1 | # 1.Parameterized configuration - REusable configurations
ise C:\Scripts\DSC1\Mod6\1.config_param.ps1
# 2. Credentials
ise C:\Scripts\DSC1\Mod6\2.config_Credentials.ps1 # Will Fail
ise C:\Scripts\dsc1\mod6\2a.config_data.psd1 # Configuration Data
ise C:\Scripts\dsc1\Mod6\2a.Config_credential.ps1
# Show it work... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/2a.Config_credential.ps1 | 2a.Config_credential.ps1 | Configuration DirTest {
param (
[pscredential]$credential
)
Node S1 {
File DirTest1 {
DestinationPath = 'c:\DirTest'
Type = 'Directory'
Ensure = 'Present'
Credential = $Credential
}
}
}
Dirtest -Credential (Get-Credenti... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/1.config_param.ps1 | 1.config_param.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_HTTPPULL
{
param
(
[Parameter(Mandatory=$true)]
[string[]]$ComputerName,
[Parameter(Mandatory=$true)]
[string]$guid
)
Node $ComputerName
{
Settings
{
AllowModuleOverwri... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/3.config_DependsOn.ps1 | 3.config_DependsOn.ps1 | Configuration InstallIIS {
Node s1 {
WindowsFeature IIS {
Ensure = 'Present'
Name = 'web-server'
}
WindowsFeature IISMgmt {
Ensure = 'Present'
Name = 'web-Mgmt-Service'
DependsOn = "[WindowsFeature]IIS"
}
WindowsFeature IISConsole {
Ensure ... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/_ResetS1_LCM_Push.ps1 | _ResetS1_LCM_Push.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM_Push
{
Node s1
{
Settings
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
}
}
}
LCM_Push -ComputerName s1 -OutputPath C:\DSC\Mod5Config
Set-DSCLocalCo... |
PowerShellCorpus/PowerShellGallery/MVA_DSC_2015_DAY2/0.0.0.2/Scripts/DSC1/Mod6/2.config_Credentials.ps1 | 2.config_Credentials.ps1 | Configuration DirTest {
param (
[pscredential]$credential
)
Node S1 {
File DirTest1 {
DestinationPath = 'c:\DirTest'
Type = 'Directory'
Ensure = 'Present'
Credential = $Credential
}
}
}
Dirtest -Credential (Get-Credenti... |
PowerShellCorpus/PowerShellGallery/GitViz/1.1/graph.ps1 | graph.ps1 | try {
$graph ="digraph GitViz {`n"
$graph += " graph [layout=dot rankdir=BT bgcolor=`"#ffffff`" title=`"Test`"]`n`n"
$graph += " { node [shape=box style=`"rounded,filled`" fixedsize=true width=0.6 height=0.4 fontcolor=`"#ffffff`" fontname=Consolas fontsize=10]`n"
$commits = git rev-list --all --... |
PowerShellCorpus/PowerShellGallery/SIORestToolKit/2.0.1.2/Script.ps1 | Script.ps1 | #
# Script.ps1
#
|
PowerShellCorpus/PowerShellGallery/SIORestToolKit/2.0.1.2/testing/SIORESTTEST.ps1 | SIORESTTEST.ps1 | #### for testing purposes in ise
Add-Type -TypeDefinition @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate c... |
PowerShellCorpus/PowerShellGallery/xDscHelper/1.0.41.1/Examples/Sample_xWaitForItem.ps1 | Sample_xWaitForItem.ps1 | $machineNames = 'ServerA', 'ServerB'
configuration TestWaitForItem
{
param
(
[string[]]$ComputerName
)
Import-DscResource -ModuleName xDscHelper
Import-DscResource -ModuleName PSDesiredStateConfiguration
node $ComputerName
{
<# Wait for a file to reach a specific length. In th... |
PowerShellCorpus/PowerShellGallery/xDscHelper/1.0.41.1/Examples/Sample_xMaintenanceWindow.ps1 | Sample_xMaintenanceWindow.ps1 | $machineNames = 'ServerA', 'ServerB'
configuration TestMaintenance
{
param
(
[string[]]$ComputerName
)
Import-DscResource -ModuleName xDscHelper
Import-DscResource -ModuleName PSDesiredStateConfiguration
node $ComputerName
{
# Default type once
xMaintenanceWindow mw
... |
PowerShellCorpus/PowerShellGallery/TFS/2016.10.20/Update-TFSBuildDefinition.ps1 | Update-TFSBuildDefinition.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Update build definition
.EXAMPLE
Update-TFSBuildDefinition -JsonFile BuildXYZ.json
Update the build definition (create a new revision) using the data in the JSON file 'BuildXYZ'.
.NOTES
Build definiti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.