Skip to content

Instantly share code, notes, and snippets.

View lidopaglia's full-sized avatar

Lido Paglia lidopaglia

View GitHub Profile
@lidopaglia
lidopaglia / Set-ADSearchBase-Intellisense.ps1
Created July 27, 2016 20:22 — forked from irwins/Set-ADSearchBase-Intellisense.ps1
Create Custom Intellisense for AD cmdlets with SearchBase parameter using TabExpansion++ Module
<#
Author: I.C.A. Strachan
Version:
Version History:
Purpose: Custom Intellisense completion for AD cmdlets with SearchBase parameter
ActiveDirectory & TabExpansion++ module is required.
@lidopaglia
lidopaglia / Get-AVStatus.ps1
Created July 26, 2016 16:10 — forked from jdhitsolutions/Get-AVStatus.ps1
This PowerShell function uses WMI via the Get-CimInstance command to query the state of installed anti-virus products.
#requires -version 4.0
Function Get-AVStatus {
<#
.Synopsis
Get anti-virus product information
.Description
This command uses WMI via the Get-CimInstance command to query the state of installed anti-virus products. The default behavior is to only display enabled products, unless you use -All. You can query by computername or existing CIMSessions.
.Example
# Gets a list of open cards in a Trello board, selects a
# random one, and posts to slack as a lunch recommendation.
Import-Module SlackPS
# Slack
$slack_uri='<your_webhook_uri_here>'
$slack_channel = '<your_channel_here>'
# Trello
@lidopaglia
lidopaglia / Azure-To-RoyalTS.ps1
Created November 12, 2015 21:09 — forked from tekmaven/Azure-To-RoyalTS.ps1
RoyalTS Document Builder for Azure Virtual Machines
#Auth to your azure account
Add-AzureAccount
Import-Module 'C:\Program Files (x86)\code4ward.net\Royal TS V3\RoyalDocument.PowerShell.dll' -Force
function CreateRoyalFolderHierarchy()
{
param(
[string]$folderStructure,
[string]$splitter,
# Import the module
$RTSPSModule = Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath 'code4ward.net\Royal TS V3\RoyalDocument.PowerShell.dll'
Import-Module $RTSPSModule
# Explore available cmdlets
Get-Command -Module RoyalDocument.PowerShell
# Create a new RoyalStore in memory
$Store = New-RoyalStore -UserName ($env:USERDOMAIN + '\' + $env:USERNAME)
[1] scripts:\> $itunes = New-Object -ComObject itunes.application
[2] scripts:\> $itunes.CurrentTrack
[3] scripts:\> $itunes.play()
[4] scripts:\> $itunes.CurrentTrack
Name : (Untitled)
Index : 104
sourceID : 72
playlistID : 21271
@lidopaglia
lidopaglia / open-ps-here.reg
Created September 20, 2014 15:10
Adds 'Open PowerShell window here' via ConEmu to the Windows Explorer context menu (shift+right click).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
@="Open PowerShell window here"
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="\"C:\\Program Files\\ConEmu\\ConEmu64.exe\" /cmd powershell -noexit -command cd '%V'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]
@="Open PowerShell window here"
@lidopaglia
lidopaglia / Connect-RDP.ps1
Created July 2, 2014 15:49
Connect to one or more hosts via RDP
<#
This Gist was created by ISEGist
07/02/2014 11:49:27
#>
#requires -Version 4.0
<#
.SYNOPSIS
Make an RDP connection.
@lidopaglia
lidopaglia / Test-Params.ps1
Created May 26, 2014 22:42
Description for Test-Params.ps1
<#
This Gist was created by ISEGist
05/26/2014 18:42:33
#>
function Test-BoundParams
{
<#
.SYNOPSIS
Add a parameter with default value to PSBoundParameters
#>
@lidopaglia
lidopaglia / Resize-ConsoleWindow.ps1
Last active January 13, 2018 19:50
Resize console window/buffer using arrow keys
<#
This Gist was created by ISEGist
04/03/2014 20:11:13
#>
# Resize the standard console window
function Resize-ConsoleWindow
{
##
## Author : Roman Kuzmin
## Synopsis : Resize console window/buffer using arrow keys