Skip to content

Instantly share code, notes, and snippets.

@h4r7w3l1
h4r7w3l1 / cheatsheet.ps1
Created April 1, 2024 00:16 — forked from pcgeek86/cheatsheet.ps1
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
@h4r7w3l1
h4r7w3l1 / readme.md
Last active October 27, 2023 14:27
whois_cli.csx

whois_cli

Implementation of whois writen on dotnet-scripts

Make sure you have installed dotnet tool for running .csx extensions

  • Try in cli:
dotnet script https://gist.githubusercontent.com/h4r7w3l1/23fcca5f7b21ed3709d8e138966ffdf3/raw/6df94156a4a2d91f6d81b59615717f3444341539/whois_cli.csx "yandex.ru" "rambler.ru" "notreallyexistedfuckingdomain.com"
List<int> numList = new List<int>{1, 2, 4, 5, 12, 55};
int theSum = 0;
foreach(int i in numList)
{
theSum = theSum + i;
System.Console.WriteLine($"{i.ToString()} > {theSum.ToString()}");
}
System.Console.WriteLine("Total: "+theSum.ToString());
string hreflink = "http://dpomain.com/path/somefile.txt";
//string hreflink = "http://cdn.p30download.com/.Mozilla.Firefox.v58.0.x86_p30download.com.zip";
Console.WriteLine("link: "+ hreflink);
Uri uri = new Uri(hreflink);
Console.WriteLine("uri: "+ uri);
string filename = System.IO.Path.GetFileName(uri.LocalPath);
Console.WriteLine("GetFileName: "+ filename);