Skip to content

Instantly share code, notes, and snippets.

View virtualex-itv's full-sized avatar
:electron:
"I drink and I know things" ~Tyrian Lanister

Alex López virtualex-itv

:electron:
"I drink and I know things" ~Tyrian Lanister
View GitHub Profile
@turibbio
turibbio / WriteFormattedOutput.ps1
Created August 18, 2015 23:08
Write colored output with Powershell cmdlet Write-Output
function Write-FormattedOutput
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)][Object] $Object,
[Parameter(Mandatory=$False)][ConsoleColor] $BackgroundColor,
[Parameter(Mandatory=$False)][ConsoleColor] $ForegroundColor
)
# save the current color
@MyITGuy
MyITGuy / Get-OSProductType.ps1
Last active November 1, 2023 19:07
PowerShell: Get the operating system product type.
function Get-OSProductType {
[CmdletBinding(SupportsShouldProcess=$True,DefaultParameterSetName="None")]
PARAM(
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true)]
[string]$ComputerName = $env:COMPUTERNAME
)
<#
.SYNOPSIS
Get the operating system product type.
.DESCRIPTION
@Integralist
Integralist / GitHub curl.sh
Last active February 6, 2025 20:47 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"