full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day2/day2.Homework/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day2/day2.Homework/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day2/day2.Homework/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day2/day2.Homework/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/packages/Machine.Specifications.0.9.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($false -eq $false)
{
Write-Warning "This is the unsigned version of Machine.Specifications. Use 'Install-Package Machine.Specifications-Signed' to install the signed version."
} |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/day1/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/TatyanaLukashevich_EPAM.MVC.2016S.Lukashevich/Day4/Models/Models/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/VernAnderson_PowerShell/Get-DelayedServices.ps1 | Get-DelayedServices.ps1 | Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Services -EA SilentlyContinue | Where-Object {$_.Property -contains "DelayedAutoStart"}
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Disable-ServerManager.ps1 | Disable-ServerManager.ps1 | Get-ScheduledTask ServerManager | Disable-ScheduledTask
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Toggle-FolderInheritance.ps1 | Toggle-FolderInheritance.ps1 | # setup the test folders
md c:\grandfather\father\son
md c:\grandmother\mother\daughter
# By default the folders will inherit ACLs from the C: drive
# To toggle it or change it to the desired setting
# Will force the inheritance from parent
$inheritance = get-acl c:\grandmother
$inheritance.SetAccessRulePr... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Covert-MaskToCIDR.ps1 | Covert-MaskToCIDR.ps1 | #Remove the # in front of $IPwSubnet depending upon the input you want to test and remark the other one out with #
#$IPwSubnet = "192.168.1.10 255.255.255.0"
$IPwSubnet = "192.168.1.10/24"
#Determine the class
#If you would like the class to be displayed remove the "} #" after the cls
[int]$FirstOctet = $IPw... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Zip-IISLogFiles.ps1 | Zip-IISLogFiles.ps1 | <#
.Synopsis
Compresses IIS logs based on provided age in days
.DESCRIPTION
Creates ZIP Archives in the default IIS log file path with a date code based on log file age adds those logs to the ZIP then removes the aged logs, also removes ZIP Archives based on a second parameter for ZIP file age in days.
If... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Delete-UserProfile.ps1 | Delete-UserProfile.ps1 | # In sysdm.cpl advanced tab you can do this in the GUI
# Here's how in PowerShell
$UserSID = (Get-WmiObject Win32_UserProfile | Where {$_.LocalPath -match 'Dale.Eatme'}).SID
(gwmi -class Win32_UserProfile -filter "SID='$UserSID'").Delete()
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-DomainRole.ps1 | Get-DomainRole.ps1 | $DomainRole = (Get-WmiObject Win32_ComputerSystem).DomainRole
switch ($DomainRole) {
0 {"Stand Alone Workstation"}
1 {"Member Workstation"}
2 {"Standalone Server"}
3 {"Member Server"}
4 {"Backup Domain Controller"}
5 {"Primary Domain Controller"}
}
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-CPUAllocation.ps1 | Get-CPUAllocation.ps1 | <#
.Synopsis
Generates Hyper-V CPU allocation report
.DESCRIPTION
This script will generate VM resource allocation information to provide an idea of how much you have used and what is still available
.EXAMPLE
Get-CPUAllocation
.EXAMPLE
Or just run it from ISE, you can also just paste the whole t... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-IISLogFilePath.ps1 | Get-IISLogFilePath.ps1 | Function Get-IISLogFilePath
{
# Load the PowerShell Module for IIS
Import-Module WebAdministration
$Sites = Get-ItemProperty 'IIS:\Sites\*'
foreach ($Site in $Sites)
{
$SiteID = $Site.ID
$LogPath = $Site.logFile.directory
$Logpath = $LogPath.Replace("%SystemDrive%",$env:SystemDrive)
"$L... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-MemoryAllocation.ps1 | Get-MemoryAllocation.ps1 | <#
.Synopsis
Generates Hyper-V memory allocation report
.DESCRIPTION
This script will generate VM resource allocation information to provide an idea of how much you have used and what is still available
.EXAMPLE
Get-MemoryAllocation
.EXAMPLE
Or just run it from ISE, you can also just paste the w... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-ProcessEXERecentlyModified.ps1 | Get-ProcessEXERecentlyModified.ps1 | $90days = (Get-Date).AddDays(-90)
Get-Process | Select-Object Path -Unique | Get-Item | Where-Object {$_.LastWriteTime -gt $90days} | Format-Table LastWriteTime,Name
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-SheduledTasks.ps1 | Get-SheduledTasks.ps1 | $ErrorActionPreference = 'SilentlyContinue'
Set-Location $ENV:SystemRoot\System32\Tasks
Get-ChildItem | Where-Object {!$_.PSIsContainer} |
ForEach-Object {
[xml]$tasks = get-content $_.FullName
$NextRun = $tasks.task.Triggers.CalendarTrigger.StartBoundary
@{"Name"=$_.Name},
@{"Enabled"=$tasks.tas... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-ServiceSortDependency.ps1 | Get-ServiceSortDependency.ps1 | Get-Service * | Where-Object {$_.Status -ne 'Stopped'} | ForEach-Object {$_.ServicesDependedOn} | Group-Object DisplayName | Sort-Object Count -Descending | Format-Table Count,Name -AutoSize
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-SQLBackupType.ps1 | Get-SQLBackupType.ps1 | $Database = Read-Host "Enter the name of the database"
$lastfail = Get-EventLog -LogName Application -Source *SQL* -Message *Backup*$Database* | Where-Object {$_.EventID -eq 3041} | Select-Object -First 1 -ExpandProperty TimeGenerated
$18264 = Get-EventLog -LogName Application -Source *SQL* -After $lastfail -Data *$... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Disable-WindowsFirewall.ps1 | Disable-WindowsFirewall.ps1 | Import-Module NetSecurity ; Get-NetFirewallProfile | Set-NetfirewallProfile -Enabled False
# This also works by itself
# Set-NetFirewallProfile -Enabled False
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Zip-Folder.ps1 | Zip-Folder.ps1 | <#
.Synopsis
Compresses a folder path to a ZIP Archive
.DESCRIPTION
This function compresses files in a folder path to a ZIP file using the native Windows ZIP library no 3rd party DLLs needed
.EXAMPLE
Zip-Folder -Source D:\foldername -Destination D:\fullpath\zipfilename.zip
.EXAMPLE
Zip-Folder -Sour... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Recycle-Item.ps1 | Recycle-Item.ps1 | function Recycle-Item ($Path)
{
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace(0xA)
$objFolder.MoveHere($Path)
}
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Uninstall-Application.ps1 | Uninstall-Application.ps1 | #This example uninstalled Skype from my machine
#The following should all be on one line . . .
Get-WmiObject Win32_Product | Where-Object {$_.IdentifyingNumber -eq "{1845470B-EB14-4ABC-835B-E36C693DC07D}"} | Invoke-WmiMethod -Name "Uninstall"
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-InstalledApps.ps1 | Get-InstalledApps.ps1 | Get-WmiObject Win32_Product | Format-Table Name,Vendor,Version
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-LocalAdministratorsMembers.ps1 | Get-LocalAdministratorsMembers.ps1 | <#
.Synopsis
Get the members of the local Administrators Group
.DESCRIPTION
This script will list the members of the local Administrators Group using WMI not ADSI
.EXAMPLE
.\Get-LocalAdministratorsMembers.ps1
#>
$GroupComponent = "Win32_Group.Domain=""$env:COMPUTERNAME"",Name=""Administrators"""
$Part... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Create-RemoteFolder.ps1 | Create-RemoteFolder.ps1 | # Remember to enter credentials that are valid for each server in your c:\servers.txt file
$credentials = Get-Credential
$servers = Get-Content c:\servers.txt
foreach ($server in $servers)
{
$scriptsFolder = Invoke-Command -ComputerName $server -Credential $credentials -ScriptBlock {Test-Path C:\Script... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Schedule-SystemStateBackup.ps1 | Schedule-SystemStateBackup.ps1 | # Setup variables
$server = $env:computername
$UNCpath = "\\$server\Backup" # Create a shared folder and put the full UNC path here
# Test that UNC Path is working
$PathTest = Test-Path $UNCpath
if ($PathTest -eq $True) {cls ; Write-Host -ForegroundColor Cyan "Good to go!"} else {cls ; Write-Warning "UNC path i... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-SystemUptime.ps1 | Get-SystemUptime.ps1 | New-TimeSpan -Seconds (Get-WmiObject Win32_PerfFormattedData_PerfOS_System).SystemUptime | Format-Table Days,Hours,Minutes
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Convert-ToCapital.ps1 | Convert-ToCapital.ps1 | function Convert-ToCapital ($String="vern"){
[string]$1stLetter = $String[0]
$CapLetter = $1stLetter.ToUpper()
$CapLetter+$String.Substring(1)}
|
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-StorageAllocation.ps1 | Get-StorageAllocation.ps1 | <#
.Synopsis
Generates Hyper-V storage allocation report
.DESCRIPTION
This script will generate VM resource allocation information to provide an idea of how much you have used and what is still available
.EXAMPLE
Get-StorageAllocation
.EXAMPLE
Or just run it from ISE, you can also just paste the... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Get-WinSAT.ps1 | Get-WinSAT.ps1 | #Requires -RunAsAdministrator
$WinSAT = Get-ChildItem -Path $ENV:SystemRoot -Recurse -Include WinSAT.exe -ErrorAction SilentlyContinue | Where-Object {$_.Directory -notmatch "WinSxS"}
Set-Location $WinSAT.Directory
Start-Process -FilePath .\WinSAT.exe -ArgumentList "formal" -NoNewWindow -Wait
Set-Location ... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Clean-Transcript.ps1 | Clean-Transcript.ps1 | <#
.Synopsis
Removes output from a PowerShell Transcript leaving just the commands
.DESCRIPTION
This function will locate lines in a PowerShell Transcript that are most likely commands and not output
.EXAMPLE
Clean-Transcript -Transcript D:\PSClass.txt -Destination D:\JustTheCommands.txt
.EXAMPLE
Cl... |
PowerShellCorpus/Github/VernAnderson_PowerShell/Unzip-File.ps1 | Unzip-File.ps1 | <#
.Synopsis
Extract a ZIP Archive to a folder path
.DESCRIPTION
This function extracts a ZIP file placing its contents into a folder path you provide using .NET 4.5 Windows ZIP library
.EXAMPLE
Unzip-File -Source D:\foldername -Destination D:\fullpath\zipfilename.zip
.EXAMPLE
Unzip-File -Source D:\... |
PowerShellCorpus/Github/VernAnderson_PowerShell/DU.ps1 | DU.ps1 | $location = Get-Location
Get-ChildItem $location | Where-Object { $_.PSIScontainer } |
Select @{Name="Size (MB)";Expression={(Get-ChildItem $_.Fullname -Recurse |
Measure-Object -Property Length -Sum).Sum/1MB}},Fullname | Sort-Object "Size (MB)" -Descending |
Select-Object @{Name="Size (MB)";Expressio... |
PowerShellCorpus/Github/SerousDarkice_backup-and-restore-scheduled-tasks/TaskBackup.ps1 | TaskBackup.ps1 | #Run with Administrator privileges
$taskStoragePath = "\NameOfPathInTaskScheduler\" # \ is the root of the Task Scheduler
$taskBackupPath = "C:\PathToWhereXMLFileWillLive\"
$tasks = Get-ScheduledTask -TaskPath $taskStoragePath
foreach ($tasks in $tasks) { Export-ScheduledTask -TaskName $tasks.TaskName -TaskPa... |
PowerShellCorpus/Github/SerousDarkice_backup-and-restore-scheduled-tasks/RestoreTasks.ps1 | RestoreTasks.ps1 | #Run with Administrator privileges
Write-Host "Enter task account credentials"
$credential = Get-Credential
$password = $credential.GetNetworkCredential().Password #Security through obscurity
$taskBackupPath = "C:\PathToXMLFiles\"
$taskStoragePath = "\DesiredPathInTaskScheduler\" # \ is the root of the Task ... |
PowerShellCorpus/Github/KiloNiner_hello-world/other-scripts/invoke-sql.ps1 | invoke-sql.ps1 | # Found on stack exchange, allows you to perform a query against a MSSQL database with no additional dependencies.
function Invoke-SQL
{
param(
[string] $dataSource = '.\SQLEXPRESS',
[string] $database = 'MasterData',
[string] $sqlCommand = $(throw 'Please specify a query.')
)
... |
PowerShellCorpus/Github/KiloNiner_hello-world/my-scripts/get-randomstring.ps1 | get-randomstring.ps1 | <#
.SYNOPSIS
Creates a random string of characters.
.DESCRIPTION
This script creates a cryptographically random string of the given byte length.
The default length of 32 equates to 256 bits of entropy.
.PARAMETER length
The length, or entropy, in bytes of the resulting string. Default... |
PowerShellCorpus/Github/KiloNiner_hello-world/my-scripts/riddler.ps1 | riddler.ps1 | #requires -Version 3
# See help or bottom of this file for execution examples.
# Thanks to the boys at Riddler.io for their awesome system and listening to me gripe about the api.
function Get-RiddlerAuthenticationToken
{
<#
.SYNOPSIS
Returns authentication token based on input credential... |
PowerShellCorpus/Github/KiloNiner_hello-world/my-scripts/add-killbit.ps1 | add-killbit.ps1 | #requires -Version 1
function New-KillBit
{
param(
[string]$computer = $(Throw 'You must define -Computer'),
[string]$CLSID = $(Throw 'You must define -CLSID')
)
if ($CLSID -match '{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}')
{
$StdRegProv = [wmi... |
PowerShellCorpus/Github/KiloNiner_hello-world/my-scripts/check-customerrors.ps1 | check-customerrors.ps1 | #requires -Version 1
# This script will expose a function that enumerates through subdirectories
# spots web.config files and then checks for the /configuration/system.web/
# customerrors/@mode value to determine whether custom errors are shown in
# place of detailed ASP.NET errors.
function Get-CustomErrorsMode... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_22_19_59_20/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1: Download buildcore script to local
echo "download build core script to local with source url: ... |
PowerShellCorpus/Github/Microsoft_r-server-hospital-length-of-stay/SQLR/Length_Of_Stay.ps1 | Length_Of_Stay.ps1 | <#
.SYNOPSIS
Script to predict the length of stay for patients in a hospital, using SQL Server and MRS.
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$true,ParameterSetName = "LoS")]
[ValidateNotNullOrEmpty()]
[String]
$is_production = "",
[parameter(Mandatory=$true,ParameterSetName = "LoS")]
... |
PowerShellCorpus/Github/Microsoft_r-server-hospital-length-of-stay/SQLR/load_data.ps1 | load_data.ps1 | <#
.SYNOPSIS
Script to load the data into SQL Server for the Hospital Length of Stay prediction.
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$true,ParameterSetName = "LoS")]
[ValidateNotNullOrEmpty()]
[String]
$is_production = "",
[parameter(Mandatory=$true,ParameterSetName = "LoS")]
[Valida... |
PowerShellCorpus/Github/alfredcisco_MetricaExam/ProyEntidadBancaria/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
try {
# Set up variables
$timestamp = (Get-Date).ToString('yyyyMMddHHmmss')
$projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar))
$catalogName = "aspnet-$project... |
PowerShellCorpus/Github/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/alfredcisco_MetricaExam/ProyEntidadBancaria/packages/jQuery.UI.Combined.1.8.24/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $juiFileNameRegEx |
PowerShellCorpus/Github/alfredcisco_MetricaExam/ProyEntidadBancaria/packages/jQuery.UI.Combined.1.8.24/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 $juiFileNameRegEx ... |
PowerShellCorpus/Github/alfredcisco_MetricaExam/ProyEntidadBancaria/packages/jQuery.UI.Combined.1.8.24/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/alfredcisco_MetricaExam/ProyEntidadBancaria/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/berkaysucsuz_burakRepo/4P1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/berkaysucsuz_burakRepo/4P1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/berkaysucsuz_burakRepo/4P1/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/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/moohrdy_WWWCourse/Lista 8/zad3/packages/WebGrease.1.5.2/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Visual Studio execution done via NuGet Package Manager
Function VSExecution($toolsPath, $project)
{
$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
# Get the msbuild version of the project and add the import
$msbuild = [Microsof... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad3/packages/WebGrease.1.5.2/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# Return a relative path with reference to root as Uri object
# $rootPath - root path
# $relativePath - relative path
# $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine()
Function GetRelativeUri($root... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad3/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad3/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad3/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/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/moohrdy_WWWCourse/Lista 8/zad1/packages/EntityFramework.6.1.1/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.