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
<# | |
.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 |
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 GroupConfigDataExample | |
{ | |
param($environment = 'Production') | |
Node $allNodes.Where{$_.Environment -eq $environment}.NodeName | |
{ | |
Group AddServerAdminGroup | |
{ | |
Ensure = 'Present' | |
GroupName = 'Administrators' |
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
add-type -Language CSharp -TypeDefinition @" | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
using Microsoft.Win32; |
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
[DSCResource()] | |
class zRemoteApp { | |
$ErrorActionPreference = 'Stop' | |
zRemoteApp() | |
{ | |
Import-Module RemoteDesktop | |
} | |
[DscProperty(Key)] | |
[string]$Name = 'MyApp' |
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
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 |
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
Set-MpPreference -ExclusionPath 'C:\Packages\', 'C:\WindowsAzure\' |
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
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' | |
} |
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
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 |
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
$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 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 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" | |
} |
OlderNewer