This file contains hidden or 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
    
  
  
    
  | [DSCLocalConfigurationManager()] | |
| configuration LCMConfigNames | |
| { | |
| param | |
| ( | |
| [Parameter(Mandatory= $true)] | |
| [string[]]$ComputerName, | |
| [Parameter(Mandatory= $true)] | |
| [string]$regKey, | 
  
    
      This file contains hidden or 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 DisableFirewall { | |
| param () | |
| Import-DscResource –ModuleName 'NetworkingDsc' | |
| Node localhost | |
| { | |
| FirewallProfile DisableFirewall | |
| { | |
| Name = 'Domain' | |
| Enabled = 'True' | 
  
    
      This file contains hidden or 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 SecurePullServerSQLDBgMSA { | |
| Param ( | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $NodeName = 'localhost', | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $Thumbprint = " $( Throw "Provide a valid certificate thumbprint to continue" ) ", | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $Guid = " $( Throw "Provide a valid GUID to continue" ) " | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # You must have Chocolately installed first | |
| # Usage example | |
| # Install-MySoftware -Computers dc1,dc2,svr12,svr16 -Packages 'powershell.portable','microsoft-edge','microsoft-windows-terminal' | |
| Function Install-MySoftware { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter()] | |
| [string[]]$Computers, | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Function Get-Inventory { | |
| <# | |
| .SYNOPSIS | |
| Gets a variety of computer information remotely and exports it to | |
| a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS | |
| System.String Get-Inventory can accept a string value to | |
| determine the Computers parameter. | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Function Format-MerchReports { | |
| <# | |
| .SYNOPSIS | |
| Reformats and combines Merch by Amazon sales reports | |
| .DESCRIPTION | |
| 1. Deletes the first 13 rows of each CSV in $csvPath | |
| 2. Combines the data from all the files | |
| 3. Adds column headers defined in $finalHeader | |
| 4. Outputs the file to $csvPath as formatted-Merchreports.csv | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Function Get-LocalAdmins { | |
| <# | |
| .SYNOPSIS | |
| Gets the members of the local administrators of the computer | |
| and outputs the result to a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS | |
| System.String. Get-LocalAdmins can accept a string value to | |
| determine the Computers parameter. | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <# | |
| Step 1 - (on a non-DC) | |
| Add-WindowsFeature RSAT-AD-PowerShell | |
| Step 2 - Create a Security group and add all the hostnames you will use the gMSA on. | |
| These are the computers permitted to retrieve the password from AD | |
| #> | |
| $gMSA_Name = 'svc_sql' | |
| $gMSA_FQDN = 'svc_sql.hall.test' | |
| # Getting all the hostnames from the group | 
  
    
      This file contains hidden or 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
    
  
  
    
  | $labName = 'TestLab' | |
| $domain = 'test.lab' | |
| $adminAcct = 'Administrator' | |
| $adminPass = 'YourPasswordHere' | |
| $labsources = "D:\LabSources" | |
| #Create an empty lab template and define where the lab XML files and the VMs will be stored | |
| New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV | |
| #Network definition | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #1 | |
| Get-Service | Where-object { $_.Status -eq 'Running' -and $_.name -like 's*'} | |
| #2 | |
| Get-Service -name s*| Where-object { $_.Status -eq 'Running'} | |
| #1 | |
| Measure-Command -Expression {Get-Service | Where-object { $_.Status -eq 'Running' -and $_.name -like 's*'}} | |
| #2 | |
| Measure-Command -Expression {Get-Service -name s*| Where-object { $_.Status -eq 'Running'}} | 
NewerOlder