full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/elmiraamanollahi_ASP.NET/mileStone1b/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/elmiraamanollahi_ASP.NET/mileStone1b/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/elmiraamanollahi_ASP.NET/mileStone1b/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/zhangyuxiong_Brute-force-nuget-pack/bfnp.ps1
bfnp.ps1
<# .EXAMPLE .\bfnp.ps1 -Path target dll's directory -out out nuget package directory .NOTES Brute force nuget pack #> param( [Parameter(Position=0,Mandatory=0,HelpMessage="target dll directory")] [string]$Path=$(throw "Parameter missing:-path Path"), [Parameter(Position=0,Mandatory=0,HelpMessage="nuget...
PowerShellCorpus/Github/zhangyuxiong_Brute-force-nuget-pack/pack.ps1
pack.ps1
param( [string]$Path=$(throw "Parameter missing:-path Path"), [string]$Out, #nuspec or csproj [string]$type="csproj" ) if([string]::IsNullOrWhiteSpace($Out)) { $Out=$Path } if(!(Test-Path $Out)) { New-Item $Out -type directory } $nugetexe=Join-Path $PSScriptRoot ".nuget\nuget.exe" #循环目录下的 nuspec 打包nu...
PowerShellCorpus/Github/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/10310243_4400Project/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/mmitchell14736_PowerShell-Example/FolderManip.ps1
FolderManip.ps1
<# Michael Mitchell folderManip.ps1 11/6/2014 #> function createFolder { param([string]$folderName) new-item -itemtype Directory -path "$drive:\School\Fall 2014\Survey\Homework\Batch 7\$folderName" return } function checkFolder([string]$folderName) { $var=Test-Path "$drive:\School\Fall ...
PowerShellCorpus/Github/mmitchell14736_PowerShell-Example/Menu.ps1
Menu.ps1
<# Michael Mitchell Menu.ps1 11/13/2014 #> cls $quit = "false" Do { Do { cls Write-Host " ----------Main Menu-------- 1 = Manipulate a folder 2 = PC Inventory 3 = Quit ---------------------------" $choice1 = read-host -prompt "Selec...
PowerShellCorpus/Github/mmitchell14736_PowerShell-Example/PCInventory.ps1
PCInventory.ps1
<# Michael Mitchell PCInventory.ps1 11/6/2014 #> cls $compName = get-content env:computername $quit = "false" Do { Do { cls Write-Host " -------------------PC Inventory------------------------ 1 = Details of the PC output to the shell 2 = Det...
PowerShellCorpus/Github/Tyngys_Tests_web-site/CP/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/Tyngys_Tests_web-site/CP/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/Tyngys_Tests_web-site/CP/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/Tyngys_Tests_web-site/CP/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/Tyngys_Tests_web-site/CP/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/zinge_scripts/own.ps1
own.ps1
<# import-module <filepath>\own.ps1 first #> Function get-own { Param ( #search $username in object owners [Parameter(Mandatory=$true)] [String]$username, #look objects recursively in this $startPath [Parameter(Mandatory=$true)] [String]$startPath ) Process { #sea...
PowerShellCorpus/Github/zinge_scripts/shareDump.ps1
shareDump.ps1
<# .SYNOPSIS Dump/Restore share permissions to $sharesXmlFile file. .DESCRIPTION The function for share permissions migration. .PARAMETER $srvName Specifies the server name for export share permissions to $sharesXmlFile. .PARAMETER $sharesXmlFile Specifies the file name for export share permission...
PowerShellCorpus/Github/Apoc70_Set-MailboxQuota/Set-MailboxQuota.ps1
Set-MailboxQuota.ps1
<# .SYNOPSIS Set default mailbox quotas per Exchange Server 2013 mailbox Thomas Stensitzki THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. Version 1.4, 2017-04-20 ...
PowerShellCorpus/Github/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/packages/Microsoft.ApplicationInsights.WindowsServer.2.1.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/developer0329_LPC-ASP.NET_SPA/LPC/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/Roundes_TFS/sandbox/ConsoleApplication1/packages/Newtonsoft.Json.9.0.1/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://www.newtonsoft.com/json/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindo...
PowerShellCorpus/Github/Roundes_TFS/sandbox/trigger/Trigger/Trigger/packages/Newtonsoft.Json.10.0.1/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://www.newtonsoft.com/json/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindo...
PowerShellCorpus/Github/Roundes_TFS/sandbox/trigger/Trigger/Trigger/packages/Microsoft.Bcl.Build.1.0.14/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne...
PowerShellCorpus/Github/Roundes_TFS/sandbox/trigger/Trigger/Trigger/packages/Microsoft.Bcl.Build.1.0.14/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project # Normalize project path before calli...
PowerShellCorpus/Github/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/Roundes_TFS/sandbox/Task2/MVCUI/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/YingXue_AzureDocumentDb/ConnectDocumentDbFromPowerShell/DocumentDBHelper.ps1
DocumentDBHelper.ps1
<# FILE: DocumentDbHelper.ps1 DEV: yingxue SUMMARY: DocumentDB helper functions: Get databases, collections; Post document; Query documents #> function Upsert-DocumentToDocumentDB { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string]$a...
PowerShellCorpus/Github/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/murati_DapperAspNetIdentity/Dapper.AspNet.Identity/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/Stiansaeten_Powershell/DSC/ScriptFolderConfig.ps1
ScriptFolderConfig.ps1
#Requires -version 5.0 Configuration ScriptFolder { node 'localhost' { File ScriptFiles { SourcePath = '\\montel.local\netlogon\' DestinationPath = 'c:\scripts' Ensure = "Present" Type = "Directory" Recurse = $true ...
PowerShellCorpus/Github/Stiansaeten_Powershell/SQL/2016 Setup/3 - Setup SQL.ps1
3 - Setup SQL.ps1
Setup.exe /ConfigurationFile=ConfigurationFile.INI /Q
PowerShellCorpus/Github/Stiansaeten_Powershell/SQL/2016 Setup/2 - FailoverCluster.ps1
2 - FailoverCluster.ps1
#Installere Failover Clustering Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools -ComputerName MON-DB15, MON-DB16 Test-Cluster –Node MON-DB15, MON-DB16 New-Cluster –Name SQLAlwaysOn –Node MON-DB15, MON-DB16 –StaticAddress 10.10.110.30 -NoStorage
PowerShellCorpus/Github/Stiansaeten_Powershell/SQL/2016 Setup/1 - WindowsConfig.ps1
1 - WindowsConfig.ps1
#Har satt NAVN, IP osv manuelt da dette skulle ha vært gjort gjennom CM :(:( #Kjøres på hver Server med OS disk mounted Install-WindowsFeature -Name Server-Gui-Mgmt-Infra -Source wim:d:\sources\install.wim:4 #Installere CM Clienten #Installere SQL Managemet fra CM #Installere Appassure #Installere Windows ...
PowerShellCorpus/Github/Stiansaeten_Powershell/SQL/2016 Setup/4 - AlwaysOn.ps1
4 - AlwaysOn.ps1
#Kjøres på hver server #Enable always on Import-Module SQLPS $computer = $env:COMPUTERNAME $instance = 'default' $path = ("SQLSERVER:\SQL\" + $computer + "\" + $instance) Enable-SqlAlwaysOn -Path $path -Force
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/FindPublicIP.ps1
FindPublicIP.ps1
$ip = Invoke-RestMethod -uri http://checkip.amazonaws.com Invoke-RestMethod -uri "http://geoip.nekudo.com/api/$ip" | Select-Object -ExcludeProperty Country
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/RemoveW10Apps.ps1
RemoveW10Apps.ps1
$Applist = Get-AppXProvisionedPackage -online $Applist | WHere-Object {$_.packagename -like '*3DBuilder*'} | Remove-AppxProvisionedPackage -online $Applist | WHere-Object {$_.packagename -like '*Appconnector*'} | Remove-AppxProvisionedPackage -online $Applist | WHere-Object {$_.packagename -like '*BingFinance*'} |...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/Set-StaticIP.ps1
Set-StaticIP.ps1
$ipaddress = "182.168.0.255" $ipprefix = "24" $ipgw = "192.168.0.1" $ipdns = "192.168.0.1" $ipif = (Get-NetAdapter).ifIndex New-NetIPAddress -IPAddress $ipaddress -PrefixLength $ipprefix -InterfaceIndex $ipif -DefaultGateway -$ipgw
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD/Get-LastLogon.ps1
Get-LastLogon.ps1
Get-ADUser -Filter * -Properties "LastLogonDate" | Sort-Object -Property LastLogonDate -Descending | Format-Table -Property Name, LastLogonDate -AutoSize
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD/UnlockADAccount.ps1
UnlockADAccount.ps1
Search-ADAccount -LockedOut Search-ADAccount -LockedOut | Unlock-ADAccount Get-ADUser -Identity stians | Unlock-ADAccount
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD/CreateOUComputerAndUser.ps1
CreateOUComputerAndUser.ps1
Import-Module -Name ActiveDirectory $name = "ScriptTest" $domainName = "DC=Montel,DC=local" $ouPath = "OU={0},{1}" -f $name, $domainName New-ADOrganizationalUnit -Name $name -Path $domainName -ProtectedFromAccidentalDeletion $false For($you = 0; $you -le 5; $you++) { New-ADOrganizationalUnit -Nam...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD/ResetPassword.ps1
ResetPassword.ps1
Get-ADUser -Identity stians Set-ADAccountPassword -Identity stians -Reset
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD/Diverse.ps1
Diverse.ps1
New-ADOrganizationalUnit -Name TestOU1 -Path "ou=MyTestOU, dc=montel, dc=local" New-ADGroup -name TestGroup -path "ou=MyTestOU, dc=montel, dc=local" -GroupScope Universal Add-ADGroupMember -Identity TestGroup -Members TestUser5 remove-ADGroupMember -Identity TestGroup -Members TestUser5 $pwd = ConvertTo-SecureS...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/Office 365/Get-LastLogonOffice365.ps1
Get-LastLogonOffice365.ps1
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credentials -Authentication Basic -AllowRedirection Import-PSSession $Session $a = Get-Mailbox $a | Foreach {Get-MailboxStatistics $_.Identity | Select DisplayName, LastLogonTim...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/CreateComputer.ps1
CreateComputer.ps1
$strClass = "Computer" $strOUName = "CN=MyTestComputer" $objADSI = [ADSI]"LDAP://OU=MyTestOU,DC=Montel,DC=local" $objComputer = $objADSI.Create($strClass, $strOUName) $objComputer.put("sAMAccountName", "MyTestComputer") $objComputer.setInfo() #Set the account to trusted and do not require a password (not disabl...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/CreateOU.ps1
CreateOU.ps1
$ErrorActionPreference = "SilentlyContinue" $Error.Clear() $strClass = "organizationalUnit" $strOUName = "OU=MyTestOU" $objADSI = [ADSI]"LDAP://DC=Montel,DC=local" $objOU = $objADSI.Create($strClass, $strOUName) $objOU.setInfo() if ($Error.Count -ne 0) { "An error occoured during the operation. De...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/ModifySecondPage.ps1
ModifySecondPage.ps1
$objUser = [ADSI]"LDAP://CN=MyTestUser,OU=MyTestOU,DC=Montel,DC=local" $objUser.Put("streetAddress", "123 main st") $objUser.Put("postOfficeBox", "P.O. Box 12") $objUser.Put("l", "Charlotte") #City $objUser.Put("st", "SC") $objUser.Put("postalCode", "12345") $objUser.Put("c", "US") $objUser.Put("co", "United Sta...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/ModifyUserProperties.ps1
ModifyUserProperties.ps1
$objUser = [ADSI]"LDAP://CN=MyTestUser,OU=MyTestOU,DC=Montel,DC=local" $objUser.Put("SamaccountName", "myNewUser") $objUser.Put("givenName", "My") $objUser.Put("initials", "N.") $objUser.Put("sn", "User") $objUser.Put("DisplayName", "My New User") $objUser.Put("description", "simple new user") $objUser.Put("phys...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/CreateMultipleUsers.ps1
CreateMultipleUsers.ps1
$strClass = "User" $aryNames = "CN=MyBoss", "CN=MyDirect1", "CN=MyDirect2" $objADSI = [ADSI]"LDAP://OU=MyTestOU,DC=Montel,DC=local" foreach($strName in $aryNames) { $objUser = $objADSI.Create($strClass, $strName) $objUser.setInfo() }
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/ModiifyTelephoneAttributes.ps1
ModiifyTelephoneAttributes.ps1
$objUser = [ADSI]"LDAP://CN=MyTestUser,OU=MyTestOU,DC=Montel,DC=local" $objUser.Put("homePhone", "555-555-0199") $objUser.Put("pager", "555-555-0198") $objUser.Put("mobile", "555-555-0197") $objUser.Put("facsimileTelephoneNumber", "555-555-0196") $objUser.Put("ipPhone", "192.168.6.112") $objUser.Put("otherfacsimi...
PowerShellCorpus/Github/Stiansaeten_Powershell/Script/AD [ADSI]/CreateUser.ps1
CreateUser.ps1
$strClass = "User" $strName = "CN=MyTestUser" $objADSI = [ADSI]"LDAP://OU=MyTestOU,DC=Montel,DC=local" $objUser = $objADSI.Create($strClass, $strName) $objUser.put("sAMAccountName", "MyTestUser") $objUser.setInfo()