Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jay visusys

🎯
Focusing
View GitHub Profile
View Rename-FontToActualName.ps1
function Rename-FontToActualName {
[CmdletBinding()]
param (
[Parameter(Mandatory,Position=0,ValueFromPipeline)]
[String[]]
$Files,
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName)]
[String]
$LogFile
View Start-CommandMultiThreaded.ps1
function Start-CommandMultiThreaded {
#.Synopsis
# This is a quick and open-ended script multi-threader searcher
#
#.Description
# This script will allow any general, external script to be multithreaded by providing a single
# argument to that script and opening it in a seperate thread. It works as a filter in the
# pipeline, or as a standalone script. It will read the argument either from the pipeline
# or from a filename provided. It will send the results of the child script down the pipeline,
# so it is best to use a script that returns some sort of object.
View FitSingleSelectionToArtboard.jsx
/*
FitSingleSelectionToArtboard.jsx for Adobe Illustrator
Description: Proportional centering and resizing of selected object
to fit its parent artboard.
Date: July, 2022
Author: Mostly Sergey Osokin, email: hi@sergosokin.ru
Second Author: VISUSYS, Small slimdown of FitSelectionToArtboards
Release notes:
View Start-CommandMultiThreaded.ps1
function Start-CommandMultiThreaded {
#.Synopsis
# This is a quick and open-ended script multi-threader searcher
#
#.Description
# This script will allow any general, external script to be multithreaded by providing a single
# argument to that script and opening it in a seperate thread. It works as a filter in the
# pipeline, or as a standalone script. It will read the argument either from the pipeline
# or from a filename provided. It will send the results of the child script down the pipeline,
# so it is best to use a script that returns some sort of object.
View AppendToXMLExample.ps1
# HELPER FUNCTIONS
function Format-XMLPretty
{
[CmdletBinding(DefaultParameterSetName="dom")]
param
(
[Parameter(Position=0,ValueFromPipeLine=$true,Mandatory=$true,ParameterSetName="dom")]
[System.Xml.XmlDocument[]]$Xml,
[Parameter(Position=0,ValueFromPipeLine=$true,Mandatory=$true,ParameterSetName="string")]
@visusys
visusys / Get-IPWhoisXMLAPI.ps1
Last active Apr 15, 2022
Domain Whois through XMLAPI
View Get-IPWhoisXMLAPI.ps1
<#
.SYNOPSIS
Returns the parameter value that is not null or white space
and has the highest priority.
.DESCRIPTION
Returns the parameter value that is not null or white space
and has the highest priority. If all parameters are empty or
null, the default value is returned.
Priority is determined as Alpha > Beta > Default.
View Get-CurrentScriptInfo.ps1
<#
.SYNOPSIS
Gets information about the currently running script. If no parameters
are supplied, the function simply returns the current script's path.
.PARAMETER ScriptPath
Returns the fully qualified path of the script.
.PARAMETER ScriptFolder
@visusys
visusys / Confirm-WindowsPathIsValid.ps1
Created Nov 19, 2021
A robust Windows path validator.
View Confirm-WindowsPathIsValid.ps1
<#
.SYNOPSIS
Validates whether a path is correctly formatted based on chosen parameters.
.DESCRIPTION
Validates whether a path is correctly formatted based on chosen parameters.
By default, any valid path with or without a filename will succeed.
If the Container switch is set, validation will fail for paths that do not point to a directory.
If the Leaf switch is set, validation will fail for paths that do not point to a file with a file extension.
@visusys
visusys / Confirm-URLIsValid.ps1
Last active Nov 20, 2021
PowerShell 7 Port of dperini's URL Validation RegEx
View Confirm-URLIsValid.ps1
<#
.SYNOPSIS
Determines whether a URL is valid.
.DESCRIPTION
Determines whether a URL is valid and conforms to common URL syntax.
If the -Strict switch is set, all URLS must define a protocol (http/https/ftp).
The function returns a generic list of PSCustomObjects with relevant data.