Skip to content

Instantly share code, notes, and snippets.

@gpuido
gpuido / PowerShellv5_UsingNamespace.ps1
Created September 11, 2017 13:05 — forked from altrive/PowerShellv5_UsingNamespace.ps1
PowerShell v5 'using namespace' syntax test
#Require -Version 5.0
# using statement must appear before any other statements in a script.
# other using types(Assembly/Command/Module/Type) is not supported yet?
# [Enum]::GetNames('System.Management.Automation.Language.UsingStatementKind')
using namespace System.Diagnostics
using namespace System.Linq
function Main
{
@gpuido
gpuido / ToastNotification_Windows10.ps1
Created September 11, 2017 13:06 — forked from altrive/ToastNotification_Windows10.ps1
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
@gpuido
gpuido / desktopsmallicon.cmd
Created September 11, 2017 13:23 — forked from t-mat/desktopsmallicon.cmd
[Win32] [Powershell] Set Desktop Small Icon
@powershell -NoProfile -ExecutionPolicy Unrestricted "%~dp0\desktopsmallicon.ps1" %*
@gpuido
gpuido / Win32FileVersionInfoBuildPostprocessor.cs
Created September 11, 2017 13:24 — forked from t-mat/Win32FileVersionInfoBuildPostprocessor.cs
[Unity] Editor Extension - Show Win32 Executable FileVersionInfo
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
@gpuido
gpuido / Get-Date_Format_Milliseconds.ps1
Created September 11, 2017 14:22 — forked from lazywinadmin/Get-Date_Format_Milliseconds.ps1
Get-Date -Format with the milliseconds
get-date -for "yyyy-MM-dd HH:mm:ss.fffffff"
2015-05-30 17:07:25.2352256
@gpuido
gpuido / SteamShortcutCreator.ps1
Created September 11, 2017 14:35 — forked from claudenobs/SteamShortcutCreator.ps1
Creates shortcuts to all your steam games. Icons are taken either from steam installation downloaded or game executable.
# 0. Requires steamcmd. Download from https://developer.valvesoftware.com/wiki/SteamCMD. Put it in your steam directory (the one with steam.exe)
# 1. Save this script by right-click on Raw button and choose "Save link as..."
# 2. Start powershell : right click "Start" then choose "Run..." & type : powershell
# 3. Run script type : Start-Process powershell -Verb RunAs -ArgumentList "-ExecutionPolicy Unrestricted -NoExit -file `"$Home\Downloads\SteamShortcutCreator.ps1`""; exit
# 4. Give permission in pop-up
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$steamDir = if (Test-Path "C:\Program Files (x86)\Steam\steam.exe") { "C:\Program Files (x86)\Steam" }
elseif ($args[0] -and (Test-Path "$($args[0])\steam.exe")) { $args[0] }
elseif (Test-Path "$PSScriptRoot\steam.exe") { $PSScriptRoot }
elseif (Test-Path ".\steam.exe") { "." }
# ____
# / __ \________ ________ ____ ______
# / /_/ / ___/ _ \/ ___/ _ \/ __ `/ ___/
# / ____/ / / __/ / / __/ /_/ (__ )
#/_/ /_/ \___/_/ \___/\__, /____/
# /_/
# this script will automatically pull font awesome files from github via .net framework "WebClient"
# install fantastically handy ImageMagick tool from => http://www.imagemagick.org/script/binary-releases.php
# and add it to your path
if (-not [bool](Get-Command "magick.exe" -ErrorAction SilentlyContinue)) { throw "Magick.exe not in path" }
@gpuido
gpuido / Convert-WindowsImage.ps1
Created December 7, 2017 15:56 — forked from john-clark/Convert-WindowsImage.ps1
deplyment powershell scripts found on the internets
Function
Convert-WindowsImage
{
<#
.NOTES
Copyright (c) Microsoft Corporation. All rights reserved.
Use of this sample source code is subject to the terms of the Microsoft
license agreement under which you licensed this sample source code. If
@gpuido
gpuido / hyperv-r2-configonly-import.ps1
Created March 27, 2019 21:30 — forked from mrdaemon/hyperv-r2-configonly-import.ps1
Work in progress. cmdlet to import a config-only VM export on Hyper-V 2008 R2.
<#
.SYNOPSIS
Safely Imports Hyper-V Virtual Machines that were exported
as configuration only, without State Data (snapshots, VHDs, etc).
.DESCRIPTION
Hyper-V 2008 R2 removed the option to export a Virtual Machine without
its State Data (Snapshots, Virtual Disk Images (VHDs), Suspend State),
as configuration only through the GUI.
@gpuido
gpuido / Install.ps1
Created March 29, 2019 21:19 — forked from michael-golfi/Install.ps1
Windows Install Script
$User = Read-Host -Prompt "Input your username"
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).Downloa
dString('https://chocolatey.org/install.ps1'))
#
# Install Programs
#
choco install jre8 -y