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 Join-Objects($source, $extend){ | |
if($source.GetType().Name -eq "PSCustomObject" -and $extend.GetType().Name -eq "PSCustomObject"){ | |
foreach($Property in $source | Get-Member -type NoteProperty, Property){ | |
if($extend.$($Property.Name) -eq $null){ | |
continue; | |
} | |
$source.$($Property.Name) = Join-Objects $source.$($Property.Name) $extend.$($Property.Name) | |
} | |
}else{ | |
$source = $extend; |
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
<# | |
.SYNOPSIS | |
Get-SqlErrorLog is designed to quickly retrieve data from SQL Server error logs, negating the slowness of SSMS and awkwardness of manually crawling files. | |
.DESCRIPTION | |
Get-SqlErrorLog is designed to quickly retrieve data from SQL Server error logs, negating the slowness of SSMS and awkwardness of manually crawling files. | |
It is designed to be quite light in it's process, and should be quick (loading SQLPLS being the exception. |
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
#region setup | |
$WorkingDir = $psISE.CurrentFile.FullPath | Split-Path | |
Set-Location $WorkingDir | |
#Add-AzureRmAccount | |
$AAAcct = Get-AzureRmAutomationAccount -Name DSCDemo01 -ResourceGroupName DSCDemo01 | |
function Wait-AADSCCompileJob { | |
param ( | |
[parameter(Mandatory,ValueFromPipeline)] | |
[Microsoft.Azure.Commands.Automation.Model.CompilationJob] $CompileJob, |
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
#region setup | |
$WorkingDir = $psISE.CurrentFile.FullPath | Split-Path | |
Set-Location $WorkingDir | |
Add-AzureRmAccount | |
$AAAcct = Get-AzureRmAutomationAccount -Name DSCDemo01 -ResourceGroupName DSCDemo01 | |
#endregion | |
#region list local VMs | |
Get-VM | Where-Object -FilterScript {$_.State -eq 'Running'} | |
#endregion |
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
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 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
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword') |
NewerOlder