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 Start-Elevated { | |
[CmdletBinding()] | |
Param ( | |
[parameter(Mandatory = $true,ValueFromPipeline=$true,Position=0)] [String]$FilePath, | |
[parameter(Mandatory = $false,ValueFromRemainingArguments=$true,Position=1)] [String[]]$ArgumentList | |
) | |
Start-Process -verb RunAs @PSBoundParameters | |
} | |
New-Alias -Name 'sudo' -Value 'Start-Elevated' |
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
DELETE FROM [SUSDB].[dbo].[tbEventInstance] | |
WHERE [EventID] IN (381,382,384,386) |
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
<# | |
Creates a scheduled task to run a daily Update-Help on the local machine | |
#> | |
$trigger = New-JobTrigger -Weekly -At "7:30 AM" -DaysOfWeek "Monday" | |
$option = New-ScheduledJobOption -StartIfOnBattery -RequireNetwork -RunElevated | |
Register-ScheduledJob -Name UpdateHelp -ScriptBlock {Update-Help -Module * -Force} -Trigger $trigger -ScheduledJobOption $option |
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 CM_PRI | |
SELECT LP.DisplayName, | |
CP.CI_ID, | |
CPS.PkgID, | |
CPS.ContentSubFolder | |
FROM dbo.CI_ContentPackages CPS | |
INNER JOIN dbo.CIContentPackage CP | |
ON CPS.PkgID = CP.PkgID | |
LEFT OUTER JOIN dbo.CI_LocalizedProperties LP | |
ON CP.CI_ID = LP.CI_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
# https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/ | |
# Enable extra metadata options by default | |
[automount] | |
enabled = true | |
root = /mnt/ | |
options = "case=off,metadata,umask=22,fmask=11" | |
mountFsTab = false | |
options = case=off | |
# Enable DNS – even though these are turned on by default, we’ll specify here just to be explicit. |
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
Get-InstalledModule | | |
ForEach-Object { | |
$CurrentVersion = $PSItem.Version | |
Get-InstalledModule -Name $PSItem.Name -AllVersions | | |
Where-Object -Property Version -LT $CurrentVersion | |
} | Uninstall-Module -Verbose |
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
# blank prompt | |
set fish_greeting | |
# Colors: | |
set fish_color_normal F8F8F2 # the default color | |
set fish_color_command F92672 # the color for commands | |
set fish_color_quote E6DB74 # the color for quoted blocks of text | |
set fish_color_redirection AE81FF # the color for IO redirections | |
set fish_color_end F8F8F2 # the color for process separators like ';' and '&' | |
set fish_color_error F8F8F2 --background=F92672 # the color used to highlight potential errors |
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-WheelAnswer | |
{ | |
[string[]]$wheel = ( | |
"No.", | |
"Are you sure it's plugged in?", | |
"Move... I'll do it", | |
"Yes, just click OK", | |
"No, it's a scam, just delete it", | |
"The problem is on your end.", | |
"Yes, it's gone forever, that's what empty trash does.", |
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 | |
Creates firewall rules for Teams. | |
.DESCRIPTION | |
(c) Microsoft Corporation 2018. All rights reserved. Script provided as-is without any warranty of any kind. Use it freely at your own risks. | |
Must be run with elevated permissions. Can be run as a GPO Computer Startup script, or as a Scheduled Task with elevated permissions. | |
The script will create a new inbound firewall rule for each user folder found in c:\users. | |
Requires PowerShell 3.0. | |
#> |
OlderNewer