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 Measure-CommandEx { | |
<# | |
.SYNOPSIS | |
A from-scratch approach to timing command execution using Stopwatch | |
#> | |
[CmdletBinding()] | |
param( | |
# The command to test (accepts value from pipeline) | |
[Parameter(ValueFromPipeline)] | |
[ScriptBlock[]]$Command, |
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
-- TRANSLATE() and STRING_SPLIT() work with SQL Server 2016+, STRING_AGG() with 2017+. | |
-- language_id=1033 is English (simplified) | |
SELECT STRING_AGG(REPLACE(TRANSLATE(s.[value] COLLATE database_default, '():.,-/='';', '**********'), '*', ''), ' ') | |
FROM sys.messages AS msg | |
CROSS APPLY STRING_SPLIT(msg.[text], ' ') AS s | |
WHERE msg.language_id=1033 | |
--AND s.[value] COLLATE database_default NOT IN ('the', 'is', 'to', 'not', 'a', 'for', 'in', 'be', 'of', 'or', 'cannot', 'and') | |
AND s.[value] COLLATE database_default NOT LIKE '%[%@=]%' | |
GROUP BY msg.message_id |
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
#------------------------------------------------------------------------ | |
# Source File Information (DO NOT MODIFY) | |
# Source ID: 9ad32074-7adb-4822-a049-93600f966aa9 | |
# Source File: ..\Documents\SAPIEN\Projects\Gui-SSRS-Deploy\Gui-SSRS-Deploy.psproj | |
#------------------------------------------------------------------------ | |
#region Project Recovery Data (DO NOT MODIFY) | |
<#RecoveryData: | |
CAIAAB+LCAAAAAAABACNkV1rgzAUhu8L/Q/ifepHxU6IuVhdyy72QS27Had6HBkxkUTH/PeLU4dl | |
MHb5JO95XnJCT1ioD9R9Bi2w9cpx6LNW71i032DxBbXhSrJgE1BvhunuwAXeZyyBchv6u4jsoLyQ | |
6CYMCfhRQpJt7PtVEscACfWm8DQ6tZz7BplPvSXOciVKW+d4yzYzwYTOCSvUKAt8hBpT13VuOy7K |
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
# USE THIS SCRIPT TO UPLOAD LARGE .PBIX FILES TO POWER BI REPORT SERVER | |
# | |
# I needed to manually construct the form-data as PowerShell doesn't appear to have full support for | |
# this yet, though it appears to be coming soon. | |
#CREDENTIALS | |
[string]$userName = 'BIWIN\MS' | |
[string]$userPassword = 'xxxxxxxxxxxxx' | |
[securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force | |
$Credential = New-Object System.Management.Automation.PSCredential ($userName, $secStringPassword) |
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
## | |
## Windows 10 cleanup script. | |
## Remove dodgy tracking settings, unneeded services, all apps, and optional features that come with Windows 10. Make it more like Windows 7. | |
## NOTE: this was tested on Creators Update (1703) and Fall Creators Update (1709). Some of this may not work as expected on newer versions. | |
## | |
## Instructions | |
## 1. Run this script (under Powershell as Administrator): | |
## powershell -ExectionPolicy Bypass .\cleanup-win10.ps1 | |
## 2. Let it run through, you may see a few errors, this is normal | |
## 3. Reboot |
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 |
OlderNewer