Skip to content

Instantly share code, notes, and snippets.

# 移除兩個不實用的 Cmdlet Aliases
If (Test-Path Alias:curl) {Remove-Item Alias:curl}
If (Test-Path Alias:wget) {Remove-Item Alias:wget}
# 快速開啟 c:\windows\system32\drivers\etc\hosts 檔案
function hosts { notepad c:\windows\system32\drivers\etc\hosts }
# 快速產生一組亂數密碼 (預設會產生 10 個字元的密碼)
function New-Password {
<#
# winget parameter completion
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
@ShaoYuKao
ShaoYuKao / Angular 14 Dev Setup.md
Created March 4, 2023 00:32 — forked from doggy8088/Angular 18 Dev Setup.md
Angular 14 開發環境說明

Angular 14 開發環境說明

為了能讓大家能夠順利的建立起 Angular 14 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

[ 作業系統 ]

  • Windows 10 以上版本
  • Mac OS X 10.6 以上版本

[ 套件管理器 ( Mac OS X Only ) ]

@ShaoYuKao
ShaoYuKao / .. MediaCreationTool.bat .md
Created May 19, 2021 00:03 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support

Preview1

Hello! I bring news. Beside the introduction of 21H1 MCT ;)
Preview2

First, I have added create media preset(s) that when used, will send you right at the select usb or save iso dialog.
And when booting from the media, the pick edition dialog will be skipped.
The attempts I've seen in this thread were mostly failing because /Pkey option is only meant for retail bought keys, not for generic / hwid!
To overcome this limitation script simply generates a PID.txt with the key you provide and then adds it to the media sources folder.