This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Find-MappedDrives | |
Finds and returns all logically mapped drives from a computer | |
#> | |
function Find-MappedDrives { | |
param( | |
$Target = 'localhost', | |
[switch]$All |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# to do: | |
- sort apps by name in GUI | |
- add check-boxes in main form to change results (see next two items) | |
- include programs and features apps | |
- include optional listing of built-in MS apps | |
- see if you can straighten out naming and icons for AppX apps (so it looks nicer) | |
#> | |
# Functions & libs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Panel should display centered in the form. Instead it display offset to the right and bottom. | |
#> | |
[void][Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | |
[void][Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | |
[void][Reflection.Assembly]::LoadWithPartialName('System.Drawing') | |
# Main form | |
$formToolbox = New-Object System.Windows.Forms.Form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$results = ( | |
Get-AppxPackage | | |
ForEach{ | |
$thisAppx = $_ | |
$thisManifest = $_ | Get-AppxPackageManifest | |
$thisSubPath = '' | |
$thisLogoBaseName = '' | |
$thisLogoRoot = '' | |
$thisLogoUNC = '' | |
If ($thisManifest.Package.Properties.logo -like '*\*'){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of accepted app parameters | |
$appSet = 'PowerShell','Chrome','FireFox','Reader' | |
#STUB# If (Test-Path ($pathToFileWithNames)){$appSet = $importedFileStringArray} | |
# ps 2.0 compatible enum for accepted app names == [ChocoApp] | |
Add-Type -TypeDefinition "public enum ChocoApp {$($appSet -join ',')}" | |
Function Load-Chocolatey{ | |
If (-not $env:ChocoInstalled){ | |
# install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u<# Format-FortiAnalyzerReport | |
Fixes terribad formatting from FortiAnalzyer CSV exports. | |
Use: | |
Format-FortiAnalyzerReport <UNC Path to CSV> -SaveCopy | |
-FileName | |
UNC path of the CSV to fix. | |
-SaveCopy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Extract-Icons | |
Requires iconsext.exe from: | |
http://www.nirsoft.net/utils/iconsext.html | |
No documentation because I'm lazy. | |
I needed something to extract high resolution icons and couldn't find a definite | |
answer so i just reused a CMD compatible free program. | |
#> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Passing functions to remote sessions | |
https://stackoverflow.com/questions/11367367/how-do-i-include-a-locally-defined-function-when-using-powershells-invoke-comma | |
#> | |
function test-write {Write-Host 'i pood!'} | |
function test-out {'i pood!' | Out-File 'C:\users\public\documents\test.txt'} | |
$passedFunctions = "function test-write {${function:test-write}} ; function test-out {${function:test-out}}" | |
$targetPC = 'PC1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Required scripts -- this just loats the AD snapin or calls it remotely from a DC | |
.'\\ps1\functions\Import-AD.ps1' | |
$env:winnerListUNC = '\\DomainName.local\filestore\winnerList.txt' | |
$env:userOUSearchBase = 'OU=TheUsers,DC=DomainName,DC=local' | |
function global:Get-Winner { | |
param( | |
$ExcludedUsers, |
NewerOlder