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 Powershell_Apply_Admin_Rights.ps1
Param(
[Parameter(Mandatory = $True)]
[string[]]$UserIDs,
[Parameter(Mandatory = $True)]
[int]$Duration
)
foreach ($UserID in $UserIDs) {
$GrantAdminTo = "Domain\" + $UserID
@NathanTheGr8
NathanTheGr8 / Powershell_ADR_Rule.ps1
Created Dec 13, 2019
create a new SCCM Automatic Deployment Rule with powershell
View Powershell_ADR_Rule.ps1
$parms2 = @{
Description = "PS Test"
Name = "Windows Updates - Office 365 x86"
Path = "\\pathToFileShare\sccm\Software_Library\Updates\Windows Updates - Office 365 x86"
Priority = "Low"
}
New-CMSoftwareUpdateDeploymentPackage @parms2
$parms = @{
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
You can’t perform that action at this time.