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
#Requires -Version 3 | |
Function Get-PSH2013Learder { | |
<# | |
.SYNOPSIS | |
Get the Scripting Games 2013 leaderboard of a given category | |
.DESCRIPTION | |
Just for fun. | |
.PARAMETER Category |
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
#Requires -Version 3.0 | |
#Requires -Module DnsClient,ActiveDirectory | |
<# | |
.SYNOPSIS | |
Practice Event of Powershell Winter Scripting 2014 | |
.DESCRIPTION | |
Practice Event of Powershell Winter Scripting 2014 |
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
# nothing per machine, rely on user settings (default config of Windows) | |
Configuration ProxyPerUser { | |
Registry ProxyPerMachinePolicy | |
{ | |
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings' | |
ValueName = 'ProxySettingsPerUser' | |
Ensure = 'Absent' | |
Force = $true | |
} | |
Registry ProxyPerMachineWinHttPSettings |
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
# Define proxy settings per machine and configure it to access directly Internet | |
Configuration NoProxy { | |
Registry ProxyPerMachinePolicy | |
{ | |
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings' | |
ValueName = 'ProxySettingsPerUser' | |
Ensure = 'Present' | |
ValueData = '0' | |
ValueType = 'Dword' | |
Force = $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
# Define proxy settings per machine and let autodetect enabled (~default user config per machine) | |
Configuration AutodetectProxy { | |
Registry ProxyPerMachinePolicy | |
{ | |
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings' | |
ValueName = 'ProxySettingsPerUser' | |
Ensure = 'Present' | |
ValueData = '0' | |
ValueType = 'Dword' | |
Force = $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
# Define a proxy URL for a configuration script | |
Configuration ProxyURL { | |
Registry ProxyPerMachinePolicy | |
{ | |
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings' | |
ValueName = 'ProxySettingsPerUser' | |
Ensure = 'Present' | |
ValueData = '0' | |
ValueType = 'Dword' | |
Force = $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
# Define a proxy | |
Configuration Proxy { | |
Registry ProxyPerMachinePolicy | |
{ | |
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings' | |
ValueName = 'ProxySettingsPerUser' | |
Ensure = 'Present' | |
ValueData = '0' | |
ValueType = 'Dword' | |
Force = $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
function Get-FileHash | |
{ | |
[CmdletBinding(DefaultParameterSetName = "Path")] | |
param( | |
[Parameter(Mandatory=$true, ParameterSetName="Path", Position = 0)] | |
[System.String[]] | |
$Path, | |
[Parameter(Mandatory=$true, ParameterSetName="LiteralPath", ValueFromPipelineByPropertyName = $true)] | |
[Alias("PSPath")] |
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
$MetaData = New-Object System.Management.Automation.CommandMetaData (Get-Command Get-Culture -CommandType Cmdlet) | |
$functionContent = ([System.Management.Automation.ProxyCommand]::Create($MetaData)) | |
$newcode = @' | |
if ($PSBoundParameters['All']) { | |
$scriptCmd = { & { [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) }} | |
} else { | |
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Get-Culture', [System.Management.Automation.CommandTypes]::Cmdlet) | |
$scriptCmd = {& $wrappedCmd @PSBoundParameters } | |
} |
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
#Requires -Version 4.0 | |
#Requires -RunAsAdministrator | |
configuration RemoveEMET52 { | |
param | |
( | |
[string[]]$NodeName = 'localhost' | |
) | |
Node $NodeName | |
{ |
OlderNewer