full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/oriel7_PracticalAssessment/TangentSolutions/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/oriel7_PracticalAssessment/TangentSolutions/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/oriel7_PracticalAssessment/TangentSolutions/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/oriel7_PracticalAssessment/TangentSolutions/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/oriel7_PracticalAssessment/TangentSolutions/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/oriel7_PracticalAssessment/TangentSolutions/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/dennismoon_AspNetCoreNgMDB/src/AspNetCoreNgMDB/Properties/PublishProfiles/Release-publish.ps1 | Release-publish.ps1 | [cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties=@{}, $packOutput, $pubProfilePath)
# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327
try{
if ($publishProperties['ProjectGuid'] -eq $null){
$publishProperties['ProjectGuid'] = '50ae3b88-46e0-452... |
PowerShellCorpus/Github/timio_CitrixPosh/Find-UnassignedDesktops/Find-UnassignedDesktops.ps1 | Find-UnassignedDesktops.ps1 | # Author: timio
# Filename: Find-UnassignedDesktops.ps1
# Last Modified Date: 6/19/2017
<#
.SYNOPSIS
Get a list of users that are members to specified AD Security Group with unassigned Citrix desktops.
.DESCRIPTION
Outputs a text file that includes AD Info (User: FirstName,Surname,UserPrincipalName,S... |
PowerShellCorpus/Github/timio_CitrixPosh/Get-CitrixUsersEmail/Get-CitrixUsersEmail.ps1 | Get-CitrixUsersEmail.ps1 | # Author: timio
# Filename: Get-CitrixUsersEmail.ps1
# Last Modified Date: 6/19/2017
<#
.SYNOPSIS
Retrieve email addresses of corp users from Citrix environment
.DESCRIPTION
Gets email addresses of users that belong to a specific delivery group in Citrix or AD Security group. If there is no group sp... |
PowerShellCorpus/Github/timio_CitrixPosh/Get-ActiveHomeDirectories/Get-ActiveHomeDirectories.ps1 | Get-ActiveHomeDirectories.ps1 | # Author: timio
# Filename: Get-ActiveHomeDirectories.ps1
# Last Modified Date: 6/19/2017
<#
.SYNOPSIS
Retrieve user info and home directory of active/assigned Citrix Desktop Users.
.DESCRIPTION
Checks for AD module and Citrix Snapin. Retrieves user info (first name, last name, sam, upn, employeeID,... |
PowerShellCorpus/Github/timio_CitrixPosh/Compare-VDIGroups/Compare-VDIGroups.ps1 | Compare-VDIGroups.ps1 | # Author: timio
# Filename: Compare-VDIGroups.ps1
# Last Modified Date: 6/19/2017
<#
.SYNOPSIS
Compares VDI AD groups to find single user in multiple groups.
.DESCRIPTION
Returns user information (SAM account, upn, firstname, lastname, matched AD Groups, and assigned Citrix Desktops) based on AD grou... |
PowerShellCorpus/Github/Singhdpk_Login-and-Registration-API/UnderstandingWebAPI/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/Singhdpk_Login-and-Registration-API/UnderstandingWebAPI/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/Singhdpk_Login-and-Registration-API/UnderstandingWebAPI/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/Singhdpk_Login-and-Registration-API/UnderstandingWebAPI/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/Singhdpk_Login-and-Registration-API/UnderstandingWebAPI/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/SpacialData/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/cmehtarahul_mapsopenlayerJavascriptExample/project/MapSample/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/OPS-E2E-PPE_E2E_D_NewRepo_2017_4_20_28_58_25/.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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/Portfolio/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/drewcook_Portfolio/jQuery/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/msfuko_mytools/happyfrsproject.ps1 | happyfrsproject.ps1 |
$MyHostFile = "D:\\FRSVMlist-ver4.0-today.csv"
$MyOutput = "D:\\hellofrsresult-4-today.csv"
$tabName = "happyTable"
Function Parse-CSV {
import-csv $MyHostFile -header Module,Hostname,IPAddress,OS,Account1,Password1,Account2,Password2,Account3,Password3 -delimiter ',' | Where-Object {$_.OS -match "Win"}
}
... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_NewRepo_2017_6_2_8_58_36/.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/abokov_ps_scripts/Test-Disk.ps1 | Test-Disk.ps1 | <#
.Synopsis
Script to test disk IO performance
.Description
This script tests disk IO performance by creating random files on the target disk and measuring IO performance
It leaves 2 files in the WorkFolder:
A log file that lists script progress, and
a CSV file that has a record for each test... |
PowerShellCorpus/Github/abokov_ps_scripts/Azure_High_IO.ps1 | Azure_High_IO.ps1 | #------------------------------------------------------------------------------
#
# Copyright © 2015 Microsoft Corporation. All rights reserved.
#
# THIS CODE AND ANY ASSOCIATED INFORMATION ARE PROVIDED “AS IS” WITHOUT
# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE I... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/dehydrate-veriables.ps1 | dehydrate-veriables.ps1 | [CmdletBinding()]
param(
[string] $prefixes,
[string] $outpath
)
$prefixes = Get-VstsInput -Name prefixes -Require
$outpath = Get-VstsInput -Name outpath -Require
Write-VstsTaskVerbose "prefixes: $prefixes"
Write-VstsTaskVerbose "outpath: $outpath"
$prefixesList = $prefixes -split ","
forea... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/LongPathFunctions.ps1 | LongPathFunctions.ps1 | ########################################
# Private functions.
########################################
function ConvertFrom-LongFormPath {
[CmdletBinding()]
param([string]$Path)
if ($Path) {
if ($Path.StartsWith('\\?\UNC')) {
# E.g. \\?\UNC\server\share -> \\server\share
... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/OutFunctions.ps1 | OutFunctions.ps1 | # TODO: It would be better if the Out-Default function resolved the underlying Out-Default
# command in the begin block. This would allow for supporting other modules that override
# Out-Default.
$script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default")
########... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1 | ServerOMFunctions.ps1 | <#
.SYNOPSIS
Gets assembly reference information.
.DESCRIPTION
Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/FindFunctions.ps1 | FindFunctions.ps1 | <#
.SYNOPSIS
Finds files or directories.
.DESCRIPTION
Finds files or directories using advanced pattern matching.
.PARAMETER LiteralDirectory
Directory to search.
.PARAMETER LegacyPattern
Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns.
Separate multiple... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1 | LocalizationFunctions.ps1 | $script:resourceStrings = @{ }
<#
.SYNOPSIS
Gets a localized resource string.
.DESCRIPTION
Gets a localized resource string and optionally formats the string with arguments.
If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/InputFunctions.ps1 | InputFunctions.ps1 | # Hash table of known variable info. The formatted env var name is the lookup key.
#
# The purpose of this hash table is to keep track of known variables. The hash table
# needs to be maintained for multiple reasons:
# 1) to distinguish between env vars and job vars
# 2) to distinguish between secret vars and pu... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/TraceFunctions.ps1 | TraceFunctions.ps1 | <#
.SYNOPSIS
Writes verbose information about the invocation being entered.
.DESCRIPTION
Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced.
.PARAM... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1 | LoggingCommandFunctions.ps1 | $script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variabledehydration-task/ps_modules/VstsTaskSdk/ToolFunctions.ps1 | ToolFunctions.ps1 | <#
.SYNOPSIS
Asserts that a path exists. Throws if the path does not exist.
.PARAMETER PassThru
True to return the path.
#>
function Assert-Path {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$LiteralPath,
[Microsoft.PowerShell.Commands.TestPathType]$PathT... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/tests/debug-variabledehydration-task.ps1 | debug-variabledehydration-task.ps1 | #Save-Module -Name VstsTaskSdk -Path ..\processtemplate-task\ps_modules\
#Import-Module ..\variabledehydration-task\ps_modules\VstsTaskSdk
Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ..\variabledehydration-task\dehydrate-veriables.ps1')) -Verbose |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/tests/debug-variablerehydration-task.ps1 | debug-variablerehydration-task.ps1 | #Save-Module -Name VstsTaskSdk -Path ..\processtemplate-task\ps_modules\
#Import-Module ..\variablerehydration-task\ps_modules\VstsTaskSdk
Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ..\variablerehydration-task\rehydrate-veriables.ps1')) -Verbose |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/rehydrate-veriables.ps1 | rehydrate-veriables.ps1 | [CmdletBinding()]
param(
[string] $jsonfiles
)
$jsonfiles = Get-VstsInput -Name jsonfiles -Require
Write-VstsTaskVerbose "jsonfiles: $jsonfiles"
$files = Get-ChildItem -Path $jsonfiles -Recurse
Write-Output "Found $($file.count) files in $jsonfiles"
if ($files.count -eq 0)
{
Write-VstsTaskErr... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/LongPathFunctions.ps1 | LongPathFunctions.ps1 | ########################################
# Private functions.
########################################
function ConvertFrom-LongFormPath {
[CmdletBinding()]
param([string]$Path)
if ($Path) {
if ($Path.StartsWith('\\?\UNC')) {
# E.g. \\?\UNC\server\share -> \\server\share
... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/OutFunctions.ps1 | OutFunctions.ps1 | # TODO: It would be better if the Out-Default function resolved the underlying Out-Default
# command in the begin block. This would allow for supporting other modules that override
# Out-Default.
$script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default")
########... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1 | ServerOMFunctions.ps1 | <#
.SYNOPSIS
Gets assembly reference information.
.DESCRIPTION
Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/FindFunctions.ps1 | FindFunctions.ps1 | <#
.SYNOPSIS
Finds files or directories.
.DESCRIPTION
Finds files or directories using advanced pattern matching.
.PARAMETER LiteralDirectory
Directory to search.
.PARAMETER LegacyPattern
Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns.
Separate multiple... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1 | LocalizationFunctions.ps1 | $script:resourceStrings = @{ }
<#
.SYNOPSIS
Gets a localized resource string.
.DESCRIPTION
Gets a localized resource string and optionally formats the string with arguments.
If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/InputFunctions.ps1 | InputFunctions.ps1 | # Hash table of known variable info. The formatted env var name is the lookup key.
#
# The purpose of this hash table is to keep track of known variables. The hash table
# needs to be maintained for multiple reasons:
# 1) to distinguish between env vars and job vars
# 2) to distinguish between secret vars and pu... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/TraceFunctions.ps1 | TraceFunctions.ps1 | <#
.SYNOPSIS
Writes verbose information about the invocation being entered.
.DESCRIPTION
Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced.
.PARAM... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1 | LoggingCommandFunctions.ps1 | $script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`... |
PowerShellCorpus/Github/nkdAgility_vsts-variable-hydration-tasks/variablerehydration-task/ps_modules/VstsTaskSdk/ToolFunctions.ps1 | ToolFunctions.ps1 | <#
.SYNOPSIS
Asserts that a path exists. Throws if the path does not exist.
.PARAMETER PassThru
True to return the path.
#>
function Assert-Path {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$LiteralPath,
[Microsoft.PowerShell.Commands.TestPathType]$PathT... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/3 - Users & Groups/Create-TreyUsers.ps1 | Create-TreyUsers.ps1 | <#
.Synopsis
Creates the TreyResearch.net users
.Description
Create-TreyUsers reads a CSV file to create an array of users. The users are then added to the Users container in Active Directory. Additionally, Create-TreyUsers adds the user Charlie to the same AD DS Groups as the Administrator account.
.Example
Cre... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/1 - Deploy Forest & Domain/Install-myForest.ps1 | Install-myForest.ps1 | # **************************************
#
# Script Name: Promote-myFirstDC.ps1
#
# ModHist: 23 Mar, 2014 -- Initial
# : 13 Mar, 2015 -- added SecureString
#
# **************************************
#
$pwdSS = ConvertTo-SecureString -String "P@ssw0rd!" -AsPlainText -Force
Import-Module ADDSDeployment... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/1 - Deploy Forest & Domain/Get-myADVersion.ps1 | Get-myADVersion.ps1 | <#
.Synopsis
Get the current Schema version and Forest and Domain Modes
.Description
The Get-myADVersion script queries the AD to discover the current AD schema version,
and the forest mode and domain mode. If run without parameters, will query the
current AD context, or if a Domain Controller is specified, it ... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/1 - Deploy Forest & Domain/Test-myForestCreate.ps1 | Test-myForestCreate.ps1 | Import-Module ADDSDeployment
Test-ADDSForestInstallation `
-DomainName 'TreyResearch.net' `
-DomainNetBiosName 'TREYRESEARCH' `
-DomainMode 6 `
-ForestMode 6 `
-NoDnsOnNetwork `
-NoRebootOnCompletion
|
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/1 - Deploy Forest & Domain/Promote-myFirstDC.ps1 | Promote-myFirstDC.ps1 | # **************************************
#
# Script Name: Promote-myFirstDC.ps1
#
# ModHist: 23 Mar, 2014 -- Initial
# : 13 Mar, 2015 -- added SecureString
#
# **************************************
#
$pwdSS = ConvertTo-SecureString -String "P@ssw0rd!" -AsPlainText -Force
Import-Module ADDSDeployment... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/2 - DNS & DHCP/Get-Syntax.ps1 | Get-Syntax.ps1 | <#
.Synopsis
Get the syntax for a cmdlet or cmdlets
.Description
The Get-Syntax script is a wrapper script to run Get-Command <cmdlet name> -Syntax against one
or more cmdlets. This allows a quick read on the syntax expected.
.Example
Get-Syntax Get-Help
Returns the only the syntax for the Get-Help command.
... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Book Manage & Deploy Active Directory with Windows PowerShell/4 - Deploying additional addc/set-myIP.ps1 | set-myIP.ps1 | # Set-myIP.ps1
# Quick and dirty IP address setter
Param ($IP4,$IP6)
$Network = "192.168.10."
$Network6 = "2001:db8:0:10::"
$IPv4 = $Network + "$IP4"
$IPv6 = $Network6 + "$IP6"
$Gateway4 = $Network + "1"
$Gateway6 = $Network6 + "1"
$Nic = Get-NetAdapter -name Ethernet
$Nic | Set-NetIPInterface -DHCP Dis... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Boek Kjeld/MVA Jump start course scripts/02 Help system/8For_Foreach.ps1 | 8For_Foreach.ps1 | # Foreach - used often in our scripting for today
$services = Get-Service
ForEach ($service in $services) {
$service.Displayname
}
#For loop
For ($i=0;$i –lt 5;$i++) {
#do something
}
#Another way
1..5 | ForEach-Object -process {
Start calc
}
|
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Boek Kjeld/MVA Jump start course scripts/02 Help system/3ObjectMembers.ps1 | 3ObjectMembers.ps1 | #Object Members and variables
#Variables are very flexible
$Service=Get-Service -Name bits
$Service | GM
$Service.Status
$service.Stop()
$Msg="Service Name is $($service.name.ToUpper())"
$msg
#Working with multiple objects
$Services=Get-Service
$services[0]
$services[0].Status
$Services[-1].Name
"Service N... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Boek Kjeld/MVA Jump start course scripts/02 Help system/6Switch.ps1 | 6Switch.ps1 | # Switch can be easier to maintain than If statement
#and can provide additional features
Switch ($status) {
0 { $status_text = 'ok' }
1 { $status_text = 'error' }
2 { $status_text = 'jammed' }
3 { $status_text = 'overheated' }
4 { $status_text = 'empty' }
default { $status_text = 'unknown' }
}
... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Boek Kjeld/MVA Jump start course scripts/02 Help system/4Parenthesis.ps1 | 4Parenthesis.ps1 | # Parenthesis help!
#Create a txt and csv file
'DC','Client' | Out-file c:\computers.txt
"ComputerName,IPAddress" | Out-file c:\Computers.csv
"DC,192.168.3.10" | Out-file c:\Computers.csv -Append
"Client,192.168.3.100" | Out-File c:\Computers.csv -Append
#Getting names from a txt file
Get-Service -ComputerNa... |
PowerShellCorpus/Github/lilswif_School2015/Systeembeheer/deelopdracht Powershell - Online course + Boek/Boek Kjeld/MVA Jump start course scripts/02 Help system/5If.ps1 | 5If.ps1 | If ($this -eq $that) {
# commands
} elseif ($those -ne $them) {
# commands
} elseif ($we -gt $they) {
# commands
} else {
# commands
}
$Status=(Get-service -name bits).status
If ($Status -eq "Running") {
Clear-Host
Write-Output "Service is being stopped"
Stop-Service -name bits
} Els... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.