This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration BuildHyperVHost{ | |
Param( | |
[string]$DeploymentFilesPath, | |
[string]$DestinationPath | |
) | |
Import-DSCResource -ModuleName @{ModuleName="xComputerManagement";ModuleVersion="1.3.0"} | |
node localhost{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-DSCResource File -Synatx | |
File [String] #ResourceName | |
{ | |
DestinationPath = [string] | |
[Attributes = [string[]]{ Archive | Hidden | ReadOnly | System }] | |
[Checksum = [string]{ CreatedDate | ModifiedDate | SHA-1 | SHA-256 | SHA-512 }] | |
[Contents = [string]] | |
[Credential = [PSCredential]] | |
[DependsOn = [string[]]] | |
[Ensure = [string]{ Absent | Present }] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration BuildHyperVHost{ | |
Param( | |
[string]$ComputerName="blah", | |
[string]$HostIPAddress, | |
[string]$DeploymentFilesPath, | |
[string]$BaseVHDFile, | |
[string]$DestinationDrive | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration BuildHyperVHost{ | |
Param( | |
[string]$ComputerName, | |
[string]$HostIPAddress, | |
[string]$DeploymentFilesPath, | |
[string]$BaseVHDFile, | |
[string]$DestinationDrive | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PSDesiredStateConfiguration\node : Cannot bind argument to parameter 'ResourceKey' because it is an empty string. | |
At C:\Temp\Build Hyper-V Host.ps1:15 char:5 | |
+ node localhost | |
+ ~~~~ | |
+ CategoryInfo : InvalidData: (:) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException | |
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,PSDesiredStateConfiguration\node | |
Update-DependsOn : Index operation failed; the array index evaluated to null. | |
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2208 char:17 | |
+ ... Update-DependsOn $Script:NodesInThisConfiguration[$mofNod ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> $PSVersionTable | |
Name Value | |
---- ----- | |
PSVersion 5.0.10074.0 | |
WSManStackVersion 3.0 | |
SerializationVersion 1.1.0.1 | |
CLRVersion 4.0.30319.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERBOSE: [2015-05-15T19:52:37] File lock does not exist: begin processing | |
VERBOSE: [2015-05-15T19:52:37] Installing the DSC Extension... | |
VERBOSE: [2015-05-15T19:52:37] Creating | |
C:\Packages\Plugins\Microsoft.Powershell.DSC\1.9.0.0\bin\..\DSCWork\1-InProgress.Install.dsc... | |
VERBOSE: [2015-05-15T19:52:37] Reading handler environment from | |
C:\Packages\Plugins\Microsoft.Powershell.DSC\1.9.0.0\bin\..\HandlerEnvironment.json | |
VERBOSE: [2015-05-15T19:52:38] Writing handler status to C:\Packages\Plugins\Microsoft.Powershell.DSC\1.9.0.0\Status\0.status | |
VERBOSE: [2015-05-15T19:52:40] File | |
C:\Packages\Plugins\Microsoft.Powershell.DSC\1.9.0.0\bin\..\DSCWork\1-InProgress.Install.dsc exists; install in progress. | |
VERBOSE: [2015-05-15T19:52:40] Installing DSC Extension... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This can definitely be condensed into a line or two but this is a good illustration of the way I worked my way through this task | |
$DesktopFolders = Get-ChildItem -Path C:\Users\*\Desktop -Recurse | |
$DesktopFoldersSize = $DesktopFolders | Measure-Object -Property Length -Sum | |
$DesktopFolderSize | |
Count : 16072 | |
Average : | |
Sum : 22536515116 | |
Maximum : | |
Minimum : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ConfigData =@{ | |
AllNodes = @( | |
@{ | |
NodeName = "localhost" | |
PSDSCAllowPlainTextPassword = $True | |
} | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration PushLCMConfig{ | |
param( | |
[parameter(Mandatory=$True)] | |
[ValidateNotNullorEmpty()] | |
[string]$ComputerName | |
) | |
Node $ComputerName{ |