full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/harringg_Powershell/REGEX/REGEX-ADUC_CN_GoldStandard.ps1 | REGEX-ADUC_CN_GoldStandard.ps1 | $Regex = 'CN=Last\, First - ARS,OU=Users,OU=OCD,OU=Units,OU=3060,OU=PA,OU=ARS,OU=Agencies,DC=usda,DC=net','CN=First Last,OU=Users,OU=OCD,OU=Units,OU=3060,OU=PA,OU=ARS,OU=Agencies,DC=usda,DC=net'
($regex | ForEach-Object {
if (($_ -match [regex]"CN=.*\\") -eq $TRUE) {
$DN_FIRST = $_ -creplace '(^.*\\,... |
PowerShellCorpus/Github/harringg_Powershell/DHCP/Get-PA3060DhcpServerv4Lease.ps1 | Get-PA3060DhcpServerv4Lease.ps1 | function Get-PA3060DhcpServerv4Lease {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRODU... |
PowerShellCorpus/Github/harringg_Powershell/SMB_Shares/New-SMBShare_WMI_WITH_PERMISSIONS.ps1 | New-SMBShare_WMI_WITH_PERMISSIONS.ps1 | # [Modified, 7/17/2016 12:20 AM, Grant Harrington]
# Modified from source: http://stackoverflow.com/questions/20333572/how-to-create-folder-share-and-apply-ntfs-permissions
# GHC = Grant Harrington Comments, my own comments, not included in original script
#Local path
$FolderPath = 'c:\temp\grantshare'
$Shares... |
PowerShellCorpus/Github/harringg_Powershell/SMB_Shares/Get-SMBShare_ModuleSyntax.ps1 | Get-SMBShare_ModuleSyntax.ps1 | Get-SmbClientConfiguration
Get-SmbClientNetworkInterface
.\Get-SMBShare.ps1
Get-SmbShare | select *
New-SmbShare -ContinuouslyAvailable -FolderEnumerationMode
Get-SmbShare | select * -first 1 | fl
Get-SmbShare -Name M300 | select presetpathacl
(Get-SmbShare -Name M300).PresetPathAcl
$M300Share = (Get-S... |
PowerShellCorpus/Github/harringg_Powershell/SMB_Shares/New-SMBShare_WMI_WITH_PERMISSIONS-MODIFIED_GH.ps1 | New-SMBShare_WMI_WITH_PERMISSIONS-MODIFIED_GH.ps1 | # [Modified, 7/17/2016 12:20 AM, Grant Harrington]
# [Modified, 7/17/2016 7:45 PM, Grant Harrington]
# Modified from source: http://stackoverflow.com/questions/20333572/how-to-create-folder-share-and-apply-ntfs-permissions
# GHC = Grant Harrington Comments, my own comments, not included in original script
$Server... |
PowerShellCorpus/Github/harringg_Powershell/SMB_Shares/AUDIT-GetNetworkShareACLs.ps1 | AUDIT-GetNetworkShareACLs.ps1 | # [Modified, 7/18/2016 8:50 AM, Grant Harrington]
# [Modified, 7/18/2016 2:08 PM, Grant Harrington]
cls
$DateRun = get-date
$Date = Get-date -f yyMMdd_HHmm
$ScriptName = 'Audit-GetNetworkShareACLs.ps1'
$ScriptPath = 'https://github.com/harringg/Powershell/blob/master/SMB_Shares/AUDIT-GetNetworkShareACLs.ps1'
... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Rebuild-UNITS-RU-ModifyThisFolderSubfoldersAndFiles.ps1 | Rebuild-UNITS-RU-ModifyThisFolderSubfoldersAndFiles.ps1 | # [Modified, 7/15/2016 12:38 PM, Grant Harrington]
# Rebuild-UNITS-RU-ModifyThisFolderSubfoldersAndFiles.ps1
#CONSANT VARIABLES
$ScriptName = 'Rebuild-UNITS-RU-ModifyThisFolderSubfoldersAndFiles.ps1'
$Domain = 'USDA'
$RU = 'PUBLIC'
$BaseFolder = "E:\Units\{0}" -f $RU
$ADUCSG_Modify = "ARSLNDFAR-{0}-DFS-MODIFY"... |
PowerShellCorpus/Github/harringg_Powershell/ACL/SET-ACL_SnapDrive.ps1 | SET-ACL_SnapDrive.ps1 | #[Modified, 7/12/2016 7:16 PM, Grant Harrington]
#[Modified, 7/14/2016 2:24 PM, Grant Harrington]
$Date = get-date -f yyMMdd_HHmm
$ImportCSVPath = "C:\SCRIPTS"
$ImportCSVFile = "Units-Snap-ANS-IGB"
$ImportCSV = "{0}\{1}.csv" -f $ImportCSVPath,$ImportCSVFile
$SNAPDriveModify = Import-Csv $ImportCSV
$OutFileFile... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Rebuild-COMMON-List-ThisFolderOnly.ps1 | Rebuild-COMMON-List-ThisFolderOnly.ps1 | # [Modified, 7/15/2016 11:13 AM, Grant Harrington]
# Rebuild-COMMON-List-ThisFolderOnly.ps1
#CONSANT VARIABLES
$ScriptName = 'Rebuild-COMMON-List-ThisFolderOnly.ps1'
$Domain = 'USDA'
$RU = 'COMMON'
$Directory = 'COMMON'
$BaseFolder = "E:\Units\{0}" -f $RU
$ADUCSG_ListFolderOnly = "ARSLNDFAR-{0}-DFS-LIST" -f $... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Set-ACL_COMMON_List_Modify.ps1 | Set-ACL_COMMON_List_Modify.ps1 | # [Modified, 7/13/2016 3:05 PM, Grant Harrington]
# This script will apply:
# List, This Folder Only (allowing pass-through access to the directory)
# Modify, Subfolders and Files (allowing Modify rights to everything inside the directory)
# This used when your NAS folder structure is
# Parent
# -Child
# --Grand... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Rebuild-COMMON-RU-ListThisFolderOnly-ModifySubfoldersAndFilesOnly.ps1 | Rebuild-COMMON-RU-ListThisFolderOnly-ModifySubfoldersAndFilesOnly.ps1 | # [Modified, 7/15/2016 11:55 AM, Grant Harrington]
# Rebuild-COMMON-RU-ListThisFolderOnly-ModifySubfoldersAndFilesOnly.ps1
#CONSANT VARIABLES
$ScriptName = 'Rebuild-COMMON-RU-ListThisFolderOnly-ModifySubfoldersAndFilesOnly.ps1'
$Domain = 'USDA'
$RU = 'OCD'
$Directory = 'COMMON'
$BaseFolder = "E:\Units\{0}\{1}"... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Set-ACL_ProtectLabFolder.ps1 | Set-ACL_ProtectLabFolder.ps1 | <#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.3.130
Created on: 12/2/2016 8:07 AM
Created by: Grant Harrington
Organization: USDA-ARS
Filename: Set-ACL_ProtectLabFolder
=========... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Rebuild-COMMON-RU-ProtectFolder_ModifyThisFolderSubfoldersAndFiles.ps1 | Rebuild-COMMON-RU-ProtectFolder_ModifyThisFolderSubfoldersAndFiles.ps1 | # [Modified, 7/15/2016 1:36 PM, Grant Harrington]
# Rebuild-COMMON-RU-ProtectFolder_ModifyThisFolderSubfoldersAndFiles.ps1
#CONSANT VARIABLES
$ScriptName = 'Rebuild-COMMON-RU-ProtectFolder_ModifyThisFolderSubfoldersAndFiles.ps1'
$Domain = 'USDA'
$RU = 'IT'
$RUPrevious = 'PUBLIC' #If same OU, enter same value as... |
PowerShellCorpus/Github/harringg_Powershell/ACL/SET-ACL_HomeDirectory.ps1 | SET-ACL_HomeDirectory.ps1 | #[Modified, 7/12/2016 2:56 PM, Grant Harrington]
#[Modified, 7/14/2016 12:12 PM, Grant Harrington]
$Date = get-date -f yyMMdd_HHmm
$ImportCSVPath = "C:\SCRIPTS"
$ImportCSVFile = "XDrive_ACLs-AG"
$ImportCSV = "{0}\{1}.csv" -f $ImportCSVPath,$ImportCSVFile
$UserNameList = Import-Csv $ImportCSV
$OutFileFile = "{0}\... |
PowerShellCorpus/Github/harringg_Powershell/ACL/SET-ACL_LabFolderAccessRestriction.ps1 | SET-ACL_LabFolderAccessRestriction.ps1 | # [Modified, 7/14/2016 8:26 PM, Grant Harrington]
# This is the format for removing RU's Modify ACL on Sub (In this case a LAB folder)
# E:\Units\COMMON\CER\LAB-FARIS
# Animals, ANS
# Cereals, CER
# Insects, IGB
# Potatoes, SUG
# Sunflowers, SPB
#CONSANT VARIABLES
$Domain = 'USDA'
$RU = 'CER'
$RUPrevious... |
PowerShellCorpus/Github/harringg_Powershell/ACL/Get-LocalAdmin.ps1 | Get-LocalAdmin.ps1 | function Get-LocalAdmin {
<#
.SYNOPSIS
Default Synopsis
.DESCRIPTION
Default Description
.PARAMETER param1
param1 Description
.EXAMPLE
PS C:\> Get-Function -param1 'Value1'
.NOTES
NAME: Get-LocalAdmin
AUTHOR: Grant Harrington
EMAIL: grant.harrington... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_TAKEOWNership.ps1 | BUILDING-BLOCKS_TAKEOWNership.ps1 | takeown /?
$ParentDirectory = 'C:\Users'
$ChildDirectory = 'first.last'
$FilenameOrDirectory = '/f'
$Recurse = '/r'
$GiveOwnershipToAdministrators = '/a'
$DefaultAnswer = '/d'
$TakeOwnership = 'y'
$Skip = 'n'
Push-Location
cd $ParentDirectory
takeown $FilenameOrDirectory $ChildDirectory $Recurse $GiveOwn... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_VARIABLE_TYPES.ps1 | BUILDING-BLOCKS_VARIABLE_TYPES.ps1 | $a = 5
$b = "5"
$b + $a # Answer 55 (both treated as [string] and are concatonated)
$a + $b # Answer 10 (both treated as [int] and are added)
[int]$integer = 5
$integer+1 # Answer 6 (added 5 + 1)
[string]$integer = 5
$integer+1 # Answer 51 (concatonated 5 & 1) |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_VARIABLE_SCOPES.ps1 | BUILDING-BLOCKS_VARIABLE_SCOPES.ps1 | Function f1 {
$Function01 = "Grant"
$function01
}
Function f2 {
$Function01
f1
}
Function f3 {
$script:Function1 = "Created in the Script Scope"
$Funtion2 = "Created in the scope of the function"
}
f3
$Function1
$Funtion2
$myVariable = "Defined in the Script Scop... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_IF-ELSE.ps1 | BUILDING-BLOCKS_IF-ELSE.ps1 | Item01 - PathTest
#region Item01-Test
if (Item01 -eq true) {
ScriptContinues - RE: Item01 is True
Print Results of Item01
Item02 - RemGroupTest
#region Item02-Test
if (Item02 -eq True) {
ScriptContinues - RE: Item01 and Item02 are True
Print Results of Item02
Item03 - AddGroupTest
#region Item... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_Get-Member.ps1 | BUILDING-BLOCKS_Get-Member.ps1 | New-Variable -Name
$BLV = Get-BitLockerVolume
$member = $BLV | gm -MemberType Properties
$gacl = Get-Acl
$member = $gacl | gm -MemberType Properties
$gacl | fl
$gacl = Get-ChildItem
$member = $gacl | gm -MemberType Properties
Get-CimClass -ClassName win32_bios
$gacl = Get-CimInstance -ClassName win3... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_Measure-Command.ps1 | BUILDING-BLOCKS_Measure-Command.ps1 | Measure-Command {Get-ADUser -Filter {GivenName -like 'j*' -and Surname -like 'W*'}}
Measure-Command {Get-ADUser -Filter * | Where-Object {$_.GivenName -like 'j*' -and $_.Surname -like 'W*'}} |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_SDDL.ps1 | BUILDING-BLOCKS_SDDL.ps1 | $string05 = "A;;LCRPDTLOCRSDRC;;;S-1-5-21-2443529608-3098792306-3041422421-513"
$string13 = "OA;;WP;bf967953-0de6-11d0-a285-00aa003049e2;;S-1-5-21-2443529608-3098792306-3041422421-513"
Switch ($ACETypeS) {
"A" {$ACEType = "ACCESS ALLOWED"}
"D" {$ACEType = "ACCESS DENIED"}
"OA" {$ACEType =... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_FOREACH.ps1 | BUILDING-BLOCKS_FOREACH.ps1 | <# BUILDING BLOCK
Get-Service -Name B* | ForEach { $_.Pause() }
#> #end BUILDING BLOCK
<# BUILDING BLOCK
$services = Get-Service -Name B*
ForEach ($service in $services) {
$service.Pause()
}
#> #end BUILDING BLOCK
<# EXAMPLE #>
foreach ($service in $services)
{
$service | select Name,D... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_HASHTABLE.ps1 | BUILDING-BLOCKS_HASHTABLE.ps1 | $os = Get-WmiObject -Class Win32_OperatingSystem -ComputerName localhost
$cs = Get-WmiObject -Class Win32_ComputerSystem -ComputerName localhost
$bios = Get-WmiObject -Class Win32_Bios -ComputerName localhost
$proc = Get-WmiObject -Class Win32_Processor -ComputerName localhost |
Select -First 1
$props = [ordered... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_ICACLS.ps1 | BUILDING-BLOCKS_ICACLS.ps1 | icacls /?
$ParentDirectory = 'C:\Users'
$ChildDirectory = 'first.last'
$GrantAccessRights = '/grant'
$GrantUser = 'Everyone:(F)'
$AllMatchingFiles_Directories = '/t'
$PerformOnSymbolicLinkVSTarget = '/l'
$SuppressSuccessMessages = '/q'
Push-Location
cd $ParentDirectory
icacls $ChildDirectory $GrantAccessR... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_FILTER_WHERE.ps1 | BUILDING-BLOCKS_FILTER_WHERE.ps1 | Get-ChildItem | where {$_.Exists -eq $True}
Get-ChildItem -Filter ($_.Attributes -like "Directory")
help Get-ChildItem -ShowWindow
(Get-Service m*).where{$_.status -eq "Stopped"}
Get-ADComputer -Filter {(DistinguishedName -like "CN*OU=Laptops,OU=DomainComputers,DC=Fargo,DC=local")}
$BitlockerPCs = Get-ADComput... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_SWITCH_Production_REVIEW_LIVE.ps1 | BUILDING-BLOCKS_SWITCH_Production_REVIEW_LIVE.ps1 | # Place in Help Section Header
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRODUCTION REVIEW
LIVE Will run the script live in production enviro... |
PowerShellCorpus/Github/harringg_Powershell/BUILDING-BLOCKS/BUILDING-BLOCKS_ARRAYS.ps1 | BUILDING-BLOCKS_ARRAYS.ps1 | # This will take a list of PCs from the clipboard
# and allow you to quickly create an array from them
$computers = @"
ARSNDFAR573525G
ARSNDFAR541P062
ARSNDFAR5W1JTK1
"@ -split '\r\n'
$computers.Length
3 # 3 objects
$c1 = @"
ARSNDFAR573525G
ARSNDFAR541P062
ARSNDFAR5W1JTK1
"@
$c1.Length
49 # 15x3 ... |
PowerShellCorpus/Github/harringg_Powershell/REGEDIT/REGEDIT-get-childitem.ps1 | REGEDIT-get-childitem.ps1 |
cd HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf
get-childitem
Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf
Name Property ... |
PowerShellCorpus/Github/harringg_Powershell/REGEDIT/REGEDIT-Get-HKEY.ps1 | REGEDIT-Get-HKEY.ps1 | #$Path = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
#$Path = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
$Path = 'HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband'
$Path = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framewor... |
PowerShellCorpus/Github/harringg_Powershell/REGEDIT/REGEDIT-IMPORT-RegistryItem.ps1 | REGEDIT-IMPORT-RegistryItem.ps1 | <#
http://stackoverflow.com/questions/22608315/importing-registry-reg-files-fails
$destinationFolder = "C:\Users\Administrator.FARGO\Documents\REGEDIT"
Get-ChildItem $destinationFolder | ? { $_.Extension -eq '.reg' } | % {
& reg import $_.FullName
}
#>
$destinationFolder = "C:\Users\Administrator.FARGO\Docum... |
PowerShellCorpus/Github/harringg_Powershell/SOFTWARE/Uninstall-JAVA.ps1 | Uninstall-JAVA.ps1 | #################################### Assumed Actions ###########################################
## This script is running on a computer that is known to have the sofware we're looking for on it
################################################################################################
## Use the SCCM WMI ... |
PowerShellCorpus/Github/harringg_Powershell/SOFTWARE/Install-JunosPulse.ps1 | Install-JunosPulse.ps1 | Push-Location #Records the current network path
$PulseInstallerPath = '\\usda.net\ars\PA3060\INSTALLERS\JUNIPER_VPN'
$PulseFolderName = 'Juniper_JunosPulse_5.1.61601'
$PulseExe = 'JunosPulse.x64.msi'
$JNPRPreconfigFile = 'LincPass.jnprpreconfig'
$InstallerRoot = "{0}\{1}" -f $PulseInstallerPath,$PulseFolderName
... |
PowerShellCorpus/Github/harringg_Powershell/OSD/sysprep_AnyHardware_generalize_oobe_shutdown_unattend.ps1 | sysprep_AnyHardware_generalize_oobe_shutdown_unattend.ps1 | :: 2015-04-21 - determination of 32 v 64, pro v enterprise
@echo off
setlocal EnableDelayedExpansion
for /f "tokens=3-4" %%i in ('wmic os get caption /value ^| find "="') do set version=%%i & set flavor=%%j
#CMD: wmic os get caption /value
#POSH: Get-CimInstance Win32_OperatingSystem | select Caption
#RESUL... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/USMT/USMT-Workflow.ps1 | USMT-Workflow.ps1 | function Get-UsersProfileDirectories {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRODU... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/USMT/SourcePC-ScanState.ps1 | SourcePC-ScanState.ps1 | $ScriptName = SourcePC-ScanState.ps1
#region ScanState USMT
$PCName = $env:COMPUTERNAME
$LoggedInUser = $env:USERNAME
$StorPath = 'C:\User State Migration Tool\{0}_{1}\' -f $PCName,$LoggedInUser
$MigApp = '/i:migapp.xml'
$MigDocs = '/i:migdocs.xml' #Read in this documents configuration file
$MigUser = '/i:mi... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/WIN10/Remove-AppxPackage.ps1 | Remove-AppxPackage.ps1 | function Remove-ARSAppxPackage {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRODUCTION ... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/WIN10/Remove-ARSAppxPackage.ps1 | Remove-ARSAppxPackage.ps1 | function Remove-ARSAppxPackage {
<#
.SYNOPSIS
This script is to be used to remove WIN 10 AppxPackages from the base isntall
.DESCRIPTION
Intended to be run on WIN 10 with Powershell v5.0 or greater
AppxPackages (PackageFullName) are imported from a static text file (this allows the list to be... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/WIN10/Deploy-LiteTouch.ps1 | Deploy-LiteTouch.ps1 | function Deploy-LiteTouch {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
.EXAMPLE
PS C:\> Deploy-LiteTouch -ComputerName ARSNDFAR5xxxxxx
.NOTES
NAME: Export-GPOReports
AUTHOR: Grant Harrington
EMAIL: grant.harrington@ars.usda.gov
... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/WIN10/Upgrade-WIN10PRO_to_WIN10ENT.ps1 | Upgrade-WIN10PRO_to_WIN10ENT.ps1 | #[Modified, 8/11/2016 11:32 AM, Grant Harrington]
#TODO: Convert to Advanced Function
#TODO: Allow for batch input of PC names
#TODO: Check for existing OS
#Get-CimInstance Win32_OperatingSystem -ComputerName ARSNDFAR4CJHKB2
#Get-WmiObject Win32_OperatingSystem -ComputerName ARSNDFAR4CJHKB2 -Property *
#Get-WmiOb... |
PowerShellCorpus/Github/harringg_Powershell/EAD/OS/WIN10/Add-AppxPackage.ps1 | Add-AppxPackage.ps1 | #[Modified, 8/5/2016 2:48 PM, Grant Harrington]
# Reinstall built-in applications
Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”} |
PowerShellCorpus/Github/harringg_Powershell/EAD/GPMC/Get-GPOInfo.ps1 | Get-GPOInfo.ps1 | # [Modified, 7/18/2016 3:08 PM, Grant Harrington]
# [Modified, 7/18/2016 4:06 PM, Grant Harrington]
# Modifed from source: https://gallery.technet.microsoft.com/Get-GPO-informations-b02e0fdf#content
Function Get-GPOInfo {
<#
.SYNOPSIS
This function retrieves some informations about all the GPO's in a giv... |
PowerShellCorpus/Github/harringg_Powershell/EAD/GPMC/Backup-EADGPO.ps1 | Backup-EADGPO.ps1 | # Run once, then comment out
#."C:\Users\grant.harrington\Documents\GitHub\Powershell\EAD\GPMC\Get-RSGPOAll.ps1"
function Backup-EADGPO {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW ... |
PowerShellCorpus/Github/harringg_Powershell/EAD/GPMC/Get-GPResultantSetOfPolicy.ps1 | Get-GPResultantSetOfPolicy.ps1 | $ComputerName = 'localhost'
$UserName = 'first.last'
Get-GPResultantSetOfPolicy -Computer $ComputerName -User $UserName -ReportType Html -Path c:\temp\GYgpresult.html |
PowerShellCorpus/Github/harringg_Powershell/EAD/GPMC/Get-RSGPOAll.ps1 | Get-RSGPOAll.ps1 | function Get-RSGPO {
<#
.SYNOPSIS
This gathers the User Information in the PA3060 ADUC OU
.DESCRIPTION
This script is used to query the server once and add the data to a variable
upon which assorted reports can be run by placing the $PA3060_USERS in the pipeline
$PA3060_USERS is declared as a global v... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/REMOVALS/Remove-ADMemberFromGroup.ps1 | Remove-ADMemberFromGroup.ps1 | #region Remove-ADMemberFromGroup
# [Modified, 8/4/2016 8:46 PM, Grant Harrington]
# grant.harrington@ars.usda.gov
# TOOD: Convert into Advanced Function
# AD SG that contains members (USER/COMPUTER) to remove in batch
$EADGroup = 'RS.PA-usdausermigration-final'
# Sets the OU to filter on, ensuring only se... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/REMOVALS/Remove-ADUser.ps1 | Remove-ADUser.ps1 | #[Modified, 10/12/2016 5:12 PM, Grant Harrington]
#Based on GUI workflow in ADManager
#https://arsitwiki.usda.net/mediawiki/index.php/EAD_Disable_an_Account
#0. Audit existing settings
."C:\Users\grant.harrington\Documents\GitHub\Powershell\EAD\ADUC\AUDIT\Audit-ADUser.ps1"
$OutgoingEmployee = Read-Host "Enter Fi... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/USER/New-LocalADUser-ManualEntry.ps1 | New-LocalADUser-ManualEntry.ps1 | #TODO
# If Federal, add to Federal list Done 161212
# If BLDG = NCSL, add to NCSL list Done 161212
function New-LocalADUser {
<#
.SYNOPSIS
Creates a new AD user, enables the account and set the default password.
.DESCRIPTION
Creates a new AD user, ena... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/USER/Get-PA3060User.ps1 | Get-PA3060User.ps1 | function Get-PA3060Users {
<#
.SYNOPSIS
This gathers the User Information in the PA3060 ADUC OU
.DESCRIPTION
This script is used to query the server once and add the data to a variable
upon which assorted reports can be run by placing the $PA3060_USERS in the pipeline
$PA3060_USERS is declared as a gl... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/USER/Reset-EADUserPassword.ps1 | Reset-EADUserPassword.ps1 | Import-Module ActiveDirectory
function Reset-EADUserPassword {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/GROUPS/Get-ADNestedGroupMembers-TechNet-Modified.ps1 | Get-ADNestedGroupMembers-TechNet-Modified.ps1 | # https://gallery.technet.microsoft.com/scriptcenter/Get-nested-group-15f725f2#content
# Modified to include Title instead of DisplayName, [Modified, 9/1/2016 8:54 AM, Grant Harrington]
function Get-ADNestedGroupMembers {
<#
.SYNOPSIS
Author: Piotr Lewandowski
Version: 1.01 (04.08.2015) - added displayname t... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/Update-PCLocalAdminMembership.ps1 | Update-PCLocalAdminMembership.ps1 | function UPDATE-PCLocalAdminMembership {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRO... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/New-ADComputer_Wipe-Reload.ps1 | New-ADComputer_Wipe-Reload.ps1 | #[Modified, 7/31/2016 8:08 PM, Grant Harrington]
$computerInstance = new-object Microsoft.ActiveDirectory.Management.ADcomputer
New-ADcomputer -Name "ARSNDFAR4127072" -Instance $computerInstance -Path 'OU=Computers-Portable,OU=SPB,OU=Units,OU=3060,OU=PA,OU=ARS,OU=Agencies,DC=usda,DC=net' -Description 'Test PC'
S... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/AddRemove-SecurityGroupMembership-Function.ps1 | AddRemove-SecurityGroupMembership-Function.ps1 | function AddRemove-SecurityGroupMembership {
<#
.SYNOPSIS
Add/Remove PC's to ADUC Security Groups
.DESCRIPTION
.PARAMETER ADGroup
SmartCardExempt = 'ARSL-SmartCardExempt-PA3060'
RSASecurID = 'ARSL-RSA-SecurID-Computers-PA3060'
.PARAMETER AddRemove
Add = Add's PC to selected ADGr... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/Update-PCLocalAdminMembership-WIP.ps1 | Update-PCLocalAdminMembership-WIP.ps1 | $COMPUTERNAME = 'localhost'
$GroupName = 'Administrators'
#$GroupName = 'Remote Desktop Users'
FOREACH ($PC in $COMPUTERNAME) {
WRITE-HOST $PC
[string]$strComputer = $PC
#Use ADSI Adapter to format PC Name
$computer = [ADSI]("WinNT://" + $strComputer + ",computer")
... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/Existing-ADComputer_Wipe-Reload.ps1 | Existing-ADComputer_Wipe-Reload.ps1 | # Step 00: Create $PA3060_COMPUTERS array
#"C:\Users\grant.harrington\Documents\SCRIPTS\POSH\EAD\ADUC\Computers\Get-PA3060Computers-FUNCTION.ps1"
cls
# Step 01: Gather existing groups and description from PC
# PC to wipe/reload
$RemovePC = 'ARSNDFAR4127072'
$RemovePC = $NewPC
# Empty Container for new PSObject... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/Update-ADUser-PostARSNetToUSDA.ps1 | Update-ADUser-PostARSNetToUSDA.ps1 | #[Modified, 8/26/2016 9:59 AM, Grant Harrington]
$NewADUser = 'first.last'
$MoveUser = Get-aduser $NewADUser
$MangerName = 'first.last'
$Manager = Get-ADUser $MangerName
$RU = 'ANS'
$MoveTo = "OU=Users,OU={0},OU=Units,OU=3060,OU=PA,OU=ARS,OU=Agencies,DC=usda,DC=net" -f $RU
Move-ADObject -Identity $MoveUser -Ta... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/AddRemove-SecurityGroupMembership.ps1 | AddRemove-SecurityGroupMembership.ps1 | #PC to add to ARSL-RSA-SecurID-Computers-PA3060
$PCName = 'ARSNDFAR537BB82'
'ARSNDFAR40Y36V1','ARSNDFAR4224003','ARSNDFAR4719001','ARSNDFAR4930051','ARSNDFAR4930050','ARSNDFAR4819006','ARSNDFAR44BKH9'
#Location specific SmartCardExempt AD SecurityGroup
$SecurityGroup = 'ARSL-RSA-SecurID-Computers-PA3060'
$Secu... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/UPDATES/Set-UPNtoHSPDPID-SingleUser.ps1 | Set-UPNtoHSPDPID-SingleUser.ps1 | #Requires -RunAsAdministrator
#Requires -Version 3
function Set-UPNtoHSPDPID {
<#
.SYNOPSIS
Updates users UPN to 1200+HSPDPID
.DESCRIPTION
Using a CSV that contains sAMAccountName and the 10 digit HSPDPID to update the UPN in ADUC
.PARAMETER PRODUCTION
This will enable a switch ... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-PCLastBootTime.ps1 | Audit-PCLastBootTime.ps1 | #http://www.powershelladmin.com/wiki/Find_last_boot_up_time_of_remote_Windows_computers_using_WMI
$PCName = 'ARSNDFAR5WHRDZ1'
$LastBootUpTime = Get-WmiObject Win32_OperatingSystem -Comp $PCName | Select -Exp LastBootUpTime
Write-host "Last Boot Time for: $PCName"
[System.Management.ManagementDateTimeConverter]::ToD... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-ADUser-OCIO-OrgChart.ps1 | Audit-ADUser-OCIO-OrgChart.ps1 | FUNCTION Audit-ADUserOrgChart {
<#
.SYNOPSIS
This queries AD and reports Employee, Manager, Direct Reports, Title and Department (as filled out in EAD)
.DESCRIPTION
NAME: Audit-ADUserOrgChart
AUTHOR: Grant Harrington
EMAIL: grant.harringt... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-ADObject-Contact.ps1 | Audit-ADObject-Contact.ps1 | #Get-ADObject -Identity:"CN=EMAIL,OU=_EXT_CONTACTS,OU=3060,OU=PA,OU=ARS,OU=Agencies,DC=usda,DC=net" -IncludeDeletedObjects:$false -Properties:uSNCreated,description,objectClass,whenCreated,ProtectedFromAccidentalDeletion,whenChanged,canonicalName,systemFlags,uSNChanged,allowedAttributesEffective,isDeleted,displayName -... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-ADUser.ps1 | Audit-ADUser.ps1 | FUNCTION Audit-ADUser {
<#
.SYNOPSIS
This queries AD and reports on the common parameters for a given user. To be used with
"P:\IT\Shared Knowledge\Forms\AuditForms\AUDIT_AD_CHANGE.xsn"
.DESCRIPTION
NAME: Audit-ADUser
AUTHOR: Grant Harri... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-LocalAdminQuery_RemotePC.ps1 | Audit-LocalAdminQuery_RemotePC.ps1 | function Get-Function
{
<#
.SYNOPSIS
Default Synopsis
.DESCRIPTION
Default Description
.PARAMETER param1
param1 Description
.EXAMPLE
PS C:\> Get-Function -param1 'Value1'
.NOTES
NAME: Get-ADTitle
AUTHOR: Grant Harrington
EMAIL: grant.harrington@ars... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-PCLoginLogout.ps1 | Audit-PCLoginLogout.ps1 | # Source: http://www.adamtheautomator.com/active-directory-auditing-user-logon-logoff/
# Date viewed: 160212
# GH Note: Fails getting these error codes
## Find all computers in the My Desktops OU
$DesktopOU = 'OU=Desktops,OU=DomainComputers,DC=Fargo,DC=local'
$Computers = (Get-ADComputer -SearchBase $Deskt... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/AUDIT/Audit-ADGroup_ADGroupMember.ps1 | Audit-ADGroup_ADGroupMember.ps1 | #[Modified, 7/6/2016 12:02 PM, Grant Harrington]
#[Modified, 7/7/2016 11:13 AM, Grant Harrington]
function AUDIT-ADGroupMembership {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/COMPUTER/WipeLoad-ExistingADComputer_PreStage.ps1 | WipeLoad-ExistingADComputer_PreStage.ps1 | Wipe-ADComputerLogging -PRODUCTION LIVE -WipeLoadPC ARSNDFARxxxxxxx
$RemovePC
Remove-ADComputerDelete -PRODUCTION REVIEW
Remove-ADComputerDelete -PRODUCTION LIVE
New-ADComputerAdd -PRODUCTION LIVE
function Wipe-ADComputerLogging {
<#
.SYNOPSIS
.DESCRIPTION
This function gather's the existi... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/COMPUTER/Get-PA3060Computer.ps1 | Get-PA3060Computer.ps1 | function Get-PA3060Computers {
<#
.SYNOPSIS
This gathers the Computer Information from the PCs in the PA3060 ADUC OU
.DESCRIPTION
This script is used to query the server once and add the data to a variable
upon which assorted reports can be run by placing the $PA3060_COMPUTERS in the pipeline
$PA3060_... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/COMPUTER/New-EADComputer.ps1 | New-EADComputer.ps1 | #[Modified, 11/14/2016 3:26 PM, Grant Harrington]
function New-EADComputer {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER REPORTTYPE
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in producti... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/POSHTOOLS/Validate-EADsAMAccountName.ps1 | Validate-EADsAMAccountName.ps1 | $First = 'Grant'
$FirstLen = $First.Length
$Last = 'Harrington'
$LastLen = $Last.Length
$Total = ($FirstLen + $LastLen + 1)
If (($FirstLen + $LastLen + 1) -le 20) {
$Global:sAMAccountName = "{0}.{1}" -f $First,$Last
} else
{ $FirstTrimLen = ($Total - 20)
$First = $First.Substring(0,$FirstLen-$FirstTrimLen)
... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/POSHTOOLS/Validate-EADPCName.ps1 | Validate-EADPCName.ps1 | function Validate-EADPCName {
<#
.SYNOPSIS
Validate that PC
.DESCRIPTION
.PARAMETER PRODUCTION
This is used to review your results before actually running the script
REVIEW run the script to review results before running live in production enviroment
Verb-Noun -PRODUCTION REVIEW
LIVE Wil... |
PowerShellCorpus/Github/harringg_Powershell/EAD/ADUC/POSHTOOLS/Create-Password.ps1 | Create-Password.ps1 | function Create-Password
{
<#
.SYNOPSIS
Usage:
The Size parameter defines the length of the password.
The CharSets parameter define the complexity where the character U, L, N and S stands for Uppercase, Lowercase, Numerals and Symbols. If supplied in lowercase (u, l, n or s) the return... |
PowerShellCorpus/Github/rugglcon_PowerShell-Scripts/sophos/DeleteVirus.ps1 | DeleteVirus.ps1 | #Author: Connor Ruggles
#Date: June 30, 2016
#Last Modified: July 21, 2016
#path where txt docs are sent
$LogPath = "\\server\path";
#counting variable
$script:ScanCount;
$OldScanCount;
#path where report is sent
$ReportPath = "\\server\reportpath"
#path where changed table will go after header modi... |
PowerShellCorpus/Github/rugglcon_PowerShell-Scripts/sophos/VirusEmail.ps1 | VirusEmail.ps1 | #Author: Connor Ruggles
#Date: July 5, 2016
#Last Modified: July 5, 2016
#set up variables
$EmailTo = "alertemail@domain.com"
$EmailFrom = "email@domain.com"
$logPathToday = "\\server\pathtoday"
$logPathOld = "\\server\pathold"
#gets all log files from current day's scans
$logs = Get-ChildItem $logPathTo... |
PowerShellCorpus/Github/Leasle_SoapWebService_Delivery/delivery/packages/EntityFramework.SqlServerCompact.6.1.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Add-EFDefaultConnectionFactory $project 'System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework' -ConstructorArguments 'System.Data.SqlServerCe.4.0'
Add-EFProvider $project 'System.Data.SqlServerCe.4.0' 'System.Data.Entity.SqlServerCompact.SqlCe... |
PowerShellCorpus/Github/Leasle_SoapWebService_Delivery/delivery/packages/Microsoft.SqlServer.Compact.4.0.8876.1/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath VS.psd1)
$nativeBinDirectory = Join-Path $installPath "NativeBinaries"
if ($project.Type -eq 'Web Site') {
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Jo... |
PowerShellCorpus/Github/Leasle_SoapWebService_Delivery/delivery/packages/Microsoft.SqlServer.Compact.4.0.8876.1/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath VS.psd1)
if ($project.Type -eq 'Web Site') {
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$libDirectory = Join-Path $inst... |
PowerShellCorpus/Github/Leasle_SoapWebService_Delivery/delivery/packages/EntityFramework.6.1.3/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
if (Get-Module | ?{ $_.Name -eq 'EntityFramework' })
{
Remove-Module EntityFramework
}
Import-Module (Join-Path $toolsPath EntityFramework.psd1)
# SIG # Begin signature block
# MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/Leasle_SoapWebService_Delivery/delivery/packages/EntityFramework.6.1.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Initialize-EFConfiguration $project
Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer'
Write-Host
Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma... |
PowerShellCorpus/Github/davidbirt_asteroids/flask/Scripts/Activate.ps1 | Activate.ps1 | # This file must be dot sourced from PoSh; you cannot run it
# directly. Do this: . ./activate.ps1
# FIXME: clean up unused vars.
$script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = split-path (resolve-path "$THIS_PATH/..") -Parent
$script:DIR_NAME = split-path $BASE_DIR -Leaf
function global:... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/Modernizr.2.6.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/Modernizr.2.6.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/Modernizr.2.6.2/Tools/common.ps1 | common.ps1 | function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProject... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/EntityFramework.5.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' }
if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 )))
{
$thisModuleManifest = 'EntityFramework.PS3.psd1'
}
else
{
$thisModuleManifest = 'EntityFramework.psd1'
}
$thisModule... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/EntityFramework.5.0.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project)
{
$appDomain = [AppDomain]::CreateDomain(
'EntityFramework.PowerShell',
$null,
(New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' }))
... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/jQuery.1.8.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/jQuery.1.8.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/SamarMuhammad_AgeRange/AgeRangeWeb/packages/jQuery.1.8.2/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/stlth_Tarot/Private/Initialize-TarotPreference.ps1 | Initialize-TarotPreference.ps1 | <#
.Synopsis
Creates preferences file
.DESCRIPTION
Creates preferences file for user's preferred card settings
.EXAMPLE
Initialize-TarotPreference
#>
function Initialize-TarotPreference
{
[CmdletBinding(DefaultParameterSetName='Default',
SupportsShouldProcess=$true,
... |
PowerShellCorpus/Github/stlth_Tarot/Public/New-TarotDeck.ps1 | New-TarotDeck.ps1 | <#
.Synopsis
Create a new Tarot card deck
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
.INPUTS
Inputs to this cmdlet (if any)
.OUTPUTS
Output from this cmdlet (if any)
.NOTES
General notes
.COMPONENT
T... |
PowerShellCorpus/Github/stlth_Tarot/Public/Get-TarotPreference.ps1 | Get-TarotPreference.ps1 | <#
.Synopsis
Gets card name preference
.DESCRIPTION
Returns a list of user's card name preferences
.EXAMPLE
Get-TarotPreference
#>
function Get-TarotPreference
{
[CmdletBinding(ConfirmImpact='Low')]
[Alias()]
[OutputType([String])]
Param
()
Begin
{
$path =... |
PowerShellCorpus/Github/stlth_Tarot/Public/Get-TarotCard.ps1 | Get-TarotCard.ps1 | <#
.Synopsis
Get a card
.DESCRIPTION
Get a specific tarot card from the deck. If a specific card is not supplied, the whole deck is returned.
.EXAMPLE
Get-TarotCard -CardName 'The Fool'
#>
function Get-TarotCard
{
[CmdletBinding()]
[Alias()]
[OutputType([PSCustomObject])]
Param
... |
PowerShellCorpus/Github/stlth_Tarot/Public/Set-TarotPreference.ps1 | Set-TarotPreference.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
.INPUTS
Inputs to this cmdlet (if any)
.OUTPUTS
Output from this cmdlet (if any)
.NOTES
General notes
.COMPONENT
The componen... |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/jQuery.1.10.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/jQuery.1.10.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/jQuery.1.10.2/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/Modernizr.2.6.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/Modernizr.2.6.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName... |
PowerShellCorpus/Github/jring85_HelloWorld/HelloWorldGitHub/packages/Modernizr.2.6.2/Tools/common.ps1 | common.ps1 | function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProject... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.