Skip to content

Instantly share code, notes, and snippets.

@CCRcmcpe
CCRcmcpe / Add-EnvironmentPath.ps1
Last active February 6, 2022 10:32
A powershell function which adds a path to environment variable "Path", for those who hate Windows environment variable editor and its 2047 character limit.
function Add-EnvironmentPath {
[OutputType([void])]
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
[ValidateScript({ Test-Path $_ -PathType Container }, ErrorMessage = 'Invalid path.')]
[string]$Path,
[EnvironmentVariableTarget]$Target = [EnvironmentVariableTarget]::Machine,
[switch]$Beginning
)
@CCRcmcpe
CCRcmcpe / 爬取专栏图片.ps1
Last active May 3, 2022 01:31
哔哩哔哩 爬取UP主专栏图片
param (
[ValidateRange(1, 999999999)]
[int]
$userId,
[ValidateNotNullOrEmpty()]
[string]
$saveDir
)
#$sessdata = ''