Skip to content

Instantly share code, notes, and snippets.

View turboBasic's full-sized avatar
🔮
Focusing

andriy melnyk turboBasic

🔮
Focusing
View GitHub Profile
@turboBasic
turboBasic / Pass-ArgumentsToPowershell.cmd
Last active December 25, 2017 04:24
[Pass-ArgumentsToPowershell.cmd] Calling #Powershell from Cmd.exe with complex arguments with quotes and spaces
@echo off
setlocal enabledelayedexpansion
set args=%*
set args=%args:"='%
set args=%args:(=`(%
set args=%args:)=`)%
set invalid="='
if !args! == !invalid! ( set args= )
powershell.exe -noLogo -noProfile -executionPolicy Unrestricted -command "Invoke-Shimgen -path %args%; exit $lastExitCode"
@turboBasic
turboBasic / Resolve-Module.ps1
Last active December 28, 2017 14:26
[Resolve-Module.ps1] Imports and upgrades module dependencies #powershell
# by Brandon Padgett
function Resolve-Module
{
[Cmdletbinding()]
Param
(
[Parameter(Mandatory)]
[string[]] $Name
)
@turboBasic
turboBasic / Get-ADK.ps1
Last active September 2, 2024 16:55
Get-ADK.ps1 - Download & install Windows ADK. #windows #windows-adk #powershell
<#
.SYNOPSIS
Get-ADK: Get and install Windows Assessment and Deployment Kit (WADK)
.DESCRIPTION
Get-ADK is utility for downloading and installing multiple versions of Windows ADK tool.
Usage:
.\Get-ADK.ps1 command [arguments]
@turboBasic
turboBasic / routes2bb.md
Last active January 6, 2018 12:28
Routes to BeBee

Расположение

Общество садоводов "Судостроитель"

  • Карта расположения въезда в ОС "Судостроитель": https://is.gd/utakub

Схемы проезда

@turboBasic
turboBasic / berkoMap.geojson
Created January 6, 2018 12:00
Map of features of Berkovets residential area, #kyiv, #ukraine
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@turboBasic
turboBasic / Set-ModuleFunctions.ps1
Last active June 27, 2018 12:25
[Set-ModuleFunctions.ps1] dot-sources child functions to the module and populates list of public and private function names #powershell #module
#region Module initialization
foreach ($subDir in "private", "public")
{
$currentFunctions = @()
Get-ChildItem -path (Join-Path -path $PSScriptRoot -childPath $subDir) `
-filter *.ps1 -file -recurse |
ForEach-Object {
. $_.FullName
@turboBasic
turboBasic / Get-OutdatedChocoPackages.ps1
Last active June 27, 2018 12:24
[Get-OutdatedChocoPackages.ps1] Get outdated #chocolatey packages #powershell
$outdated = (choco outdated) -join "`n"
$outdated = ($outdated -replace '(?sx) ^ .* \n\n (.*) \n\n .* $', '$1') -split "`n"
$outdated |
ForEach-Object {
if ($_ -match '(?x) ^ (?<name> [^|]+) \| (?<old> [^|]+) \| (?<new> [^|]+) \| (?<pinned> [^|]+) $') {
[psCustomObject] $Matches
}
} |
Select-Object Name, New, Old, Pinned
@turboBasic
turboBasic / Select-AllWordsMatch.ps1
Last active June 27, 2018 12:23
[Select-AllWordsMatch.ps1] Selects strings where all words are present in any order #powershell #textProcessing
function Select-AllWordsMatch {
[CmdletBinding()]
Param(
[Parameter(
Mandatory,
Position = 0,
ValueFromPipelineByPropertyName
)]
[Alias( 'Word' )]
@turboBasic
turboBasic / Get-dotNetCultures.ps1
Last active June 27, 2018 12:22
[Get-dotNetCultures.ps1] Gets the list of .Net cultures #powershell #.Net
function Get-dotNetCultures
{
[Globalization.CultureInfo]::GetCultures(
[Globalization.CultureTypes]::AllCultures -as [uint32] -band
-bnot (
[Globalization.CultureTypes]::NeutralCultures
)
)
@turboBasic
turboBasic / Enable-WindowsServer2016RemoteManagement.ps1
Last active May 13, 2020 13:19
Enable-WindowsServer2016RemoteManagement.ps1 - Enable remote management of Windows Server 2016 using Powershell #powershell #windows-server #windows-server-2016 #windows #windows-10
# Based on https://serverfault.com/questions/852144/how-do-i-remotely-manage-hyper-v-2016-standalone-via-windows-10
# on the Server which you are going to start managing remotely^
# 1. run sconfig in cmd.exe
# 2. Set computer name (eg. server-1) (do NOT use periods)
# 3. Configure remote management (disabled => enabled)
# 4. Configure Remote Desktop (disabled => enabled)
# 5. start Powershell
# the following should be entered in Powershell window