Parameter | YouTube recommends setting |
---|---|
-movflags faststart | moov atom at the front of the file (Fast Start) |
This file contains hidden or 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
using namespace System.Management.Automation | |
function Write-Information { | |
<# | |
.Synopsis | |
An enhancement to the built-in Write-Information to make it show the calling script line | |
.Description | |
Creates a stopwatch that tracks the time elapsed while a script runs, and adds caller position and time to the output | |
.Example |
This file contains hidden or 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
using namespace System.Security.Principal | |
using namespace System.Security.Cryptography | |
using namespace System.Security.AccessControl | |
using namespace System.Security.AccessControl.AccessRule | |
Set-Variable -Scope Script -Name RSA_KEY_LENGTH -Value 2048 -Option Constant -ErrorAction SilentlyContinue | |
function Add-RsaKey | |
{ | |
[CmdletBinding()] |
This file contains hidden or 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 | |
Do not use underscores in command names | |
.DESCRIPTION | |
You should not use underscores in PowerShell command names | |
To fix a violation of this rule, rename your command to remove underscores. | |
.EXAMPLE | |
Measure-UnderscoreNotAllowedInFunctionName -ScriptBlockAst $ScriptBlockAst | |
.INPUTS | |
[System.Management.Automation.Language.ScriptBlockAst] |
This file contains hidden or 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
@{ | |
ModuleVersion = '16.12.1.1' | |
# QMODHelper is a meta module that exists to depend upon all the Questionmark modules, but ... | |
# RequiredModules are limited/broken in PS 5.x so we work around it by importing in a RootModule | |
RootModule = 'Module.psm1' | |
RequiredModules = @() | |
<# | |
RequiredModules = @( | |
# Microsoft modules which are required (at least the first two are required just to parse the module files) |
This file contains hidden or 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
; How to use: | |
; 1. Install AuthotKey: https://www.autohotkey.com | |
; 2. Save this script in `My Documents` | |
; 3. Create a shortcut in the Startup folder (`Win`+`R`, `shell:startup`) | |
; 4. Change the configurations below | |
; 5. Start and test the script! | |
; Configuration | |
; Cultures can be fetched from here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx |
This file contains hidden or 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
install_wim_tweak.exe /o /c "Microsoft-Windows-Internet" /r | |
install_wim_tweak.exe /o /c "Adobe-Flash" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-Cortana" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-Search2" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-SearchEngine" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-RetailDemo" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-ContactSupport" /r | |
install_wim_tweak.exe /o /c "Microsoft-PPIProjection" /r | |
install_wim_tweak.exe /o /c "Microsoft-Windows-Backup" /r | |
install_wim_tweak.exe /o /c "Windows-Defender" /r |
This file contains hidden or 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 5.0 | |
#Requires -Module NetSecurity | |
param( | |
$DisplayGroup = "File and Printer Sharing", | |
[Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetSecurity.Profile]$NetworkProfile = "Domain" | |
) | |
foreach($rule in Get-NetFirewallRule -DisplayGroup $DisplayGroup) { |
This file contains hidden or 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
$script:IsWindows = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows | |
$script:IsLinux = (Get-Variable -Name IsLinux -ErrorAction Ignore) -and $IsLinux | |
$script:IsOSX = (Get-Variable -Name IsOSX -ErrorAction Ignore) -and $IsOSX | |
$script:IsCoreCLR = (Get-Variable -Name IsCoreCLR -ErrorAction Ignore) -and $IsCoreCLR | |
$script:IsNanoServer = $null -ne ('System.Runtime.Loader.AssemblyLoadContext' -as [Type]) | |
$script:IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) |
This file contains hidden or 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
## Commonly used PSADT env variables | |
$envCommonDesktop # C:\Users\Public\Desktop | |
$envCommonStartMenuPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs | |
$envProgramFiles # C:\Program Files | |
$envProgramFilesX86 # C:\Program Files (x86) | |
$envProgramData # c:\ProgramData | |
$envUserDesktop # c:\Users\{user currently logged in}\Desktop | |
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs | |
$envSystemDrive # c: | |
$envWinDir # c:\windows |