Skip to content

Instantly share code, notes, and snippets.

View TravisEz13's full-sized avatar
🎯
Focusing

Travis Plunk TravisEz13

🎯
Focusing
View GitHub Profile
<#
.summary
Test suite for MSFT_xPendingReboot.psm1
For PR https://github.com/PowerShell/xPendingReboot/pull/1
#>
[CmdletBinding()]
param()
Import-Module $PSScriptRoot\..\DSCResources\MSFT_xPendingReboot\MSFT_xPendingReboot.psm1 -Force
configuration GroupConfigDataExample
{
param($environment = 'Production')
Node $allNodes.Where{$_.Environment -eq $environment}.NodeName
{
Group AddServerAdminGroup
{
Ensure = 'Present'
GroupName = 'Administrators'
add-type -Language CSharp -TypeDefinition @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.Win32;
[DSCResource()]
class zRemoteApp {
$ErrorActionPreference = 'Stop'
zRemoteApp()
{
Import-Module RemoteDesktop
}
[DscProperty(Key)]
[string]$Name = 'MyApp'
import-module international
$list=Get-WinUserLanguageList
$list[0].InputMethodTips.Clear()
$list[0].InputMethodTips.Add('0409:00010409')
$list[0].InputMethodTips.Add('0409:00000409')
Set-WinUserLanguageList $list -Force
@TravisEz13
TravisEz13 / excludeAzureVmAgent.ps1
Last active June 30, 2017 20:18
excludeAzureVmAgent.ps1
Set-MpPreference -ExclusionPath 'C:\Packages\', 'C:\WindowsAzure\'
Set-PSRepository -Name psgallery -InstallationPolicy Trusted
Install-module xWindowsUpdate -Confirm:$false
Invoke-DscResource -Name xWindowsUpdateAgent -Method Set -ModuleName xWindowsUpdate -Property @{
IsSingleInstance = 'Yes'
UpdateNow = $false
Source = 'MicrosoftUpdate'
Notifications = 'disabled'
}
Set-ExecutionPolicy ByPass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y git.install
choco install -y visualstudiocode
choco install -y notepad2-mod
choco install -y googlechrome
$records=$false
dpkg-query -l | Foreach-Object {
$parts=$_ -split '\s+'
if($records)
{
[PSCustomObject]@{
state = $parts[0]
name = $parts[1]
version = $parts[2]
architecture = $parts[3]
#This is intended for Win7/Windows Server 2008 R2 sysprep issues with WMF 5.x
$Path ='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep\Generalize'
$acl=Get-Acl -Path $Path
$rights = $acl.Access|?{$_.IdentityReference -eq 'BUILTIN\Administrators'} | Select-Object -ExpandProperty RegistryRights
if($rights -ne 'FullControl')
{
throw "Please give administrators full control to $Path"
}