full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Invoke-RemovePath.ps1 | Invoke-RemovePath.ps1 | Function Invoke-RemovePath
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([bool])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path,
[Parameter()]
[string]$PSDriveName,
[Parameter()]
[string]$PSDri... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Invoke-ExpandArchive.ps1 | Invoke-ExpandArchive.ps1 | Function Invoke-ExpandArchive
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([bool])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Source,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Target
... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Import-MicrosoftDeploymentToolkitModule.ps1 | Import-MicrosoftDeploymentToolkitModule.ps1 | Function Import-MicrosoftDeploymentToolkitModule
{
If (-Not(Get-Module MicrosoftDeploymentToolkit))
{
Import-Module "$env:ProgramFiles\Microsoft Deployment Toolkit\Bin\MicrosoftDeploymentToolkit.psd1" -ErrorAction Stop -Global -Verbose:$False
}
}
|
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Compare-Version.ps1 | Compare-Version.ps1 | Function Compare-Version
{
[CmdletBinding()]
[OutputType([bool])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Source,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Target
)
[bool]$match = $fa... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Get-FileTypeFromPath.ps1 | Get-FileTypeFromPath.ps1 | ÔĽŅFunction Get-FileTypeFromPath
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Separator
)
[stri... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/New-ReferenceFile.ps1 | New-ReferenceFile.ps1 | Function New-ReferenceFile
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path,
[Parameter()]
[string]$PSDriveName,
[Parameter()]
[string]$PSDrivePath
)
if (($PSDri... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Get-Separator.ps1 | Get-Separator.ps1 | Function Get-Separator
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path
)
[string]$separator = ""
If ($Path -like "*/*")
{ $separator = "/" }
Else
{ $separator = "\" }
... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Invoke-Logger.ps1 | Invoke-Logger.ps1 | Function Invoke-Logger
{
param(
[String]$Severity,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[String]$Category,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[String]$Type,
$Message,
$Error
)
... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Get-PathType.ps1 | Get-PathType.ps1 | Function Get-Separator
{
[CmdletBinding()]
[OutputType([String])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path
)
[string]$separator = ""
If ($Path -like "*/*")
{ $separator = "/" }
Else
{ $separator = "\" }
... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Invoke-WebDownload.ps1 | Invoke-WebDownload.ps1 | Function Invoke-WebDownload
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([bool])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Source,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Target
... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Invoke-TestPath.ps1 | Invoke-TestPath.ps1 | Function Invoke-TestPath
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([bool])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path,
[Parameter()]
[string]$PSDriveName,
[Parameter()]
[string]$PSDrive... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Public/Get-FolderNameFromPath.ps1 | Get-FolderNameFromPath.ps1 | Function Get-FolderNameFromPath
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Path,
[Parameter(Mandatory=$True)]
[ValidateNotNullorEmpty()]
[string]$Separator
)
[strin... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/DSCResources/cMDTPreReqs/Start-adl_MDTPreReqs.ps1 | Start-adl_MDTPreReqs.ps1 | Configuration adl_MDTPreReqs
{
param (
[string[]]$ComputerName = "localhost"
)
Import-DscResource –ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName adl_MDTPreReqs
Node $ComputerName
{
adl_MDTPreReqs MDTPreReqs {
Ensure = ... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/DSCResources/cMDTPreReqs/Set-LCM.ps1 | Set-LCM.ps1 | [DSCLocalConfigurationManager()]
Configuration LCM
{
Node $env:COMPUTERNAME
{
Settings
{
AllowModuleOverwrite = $True
ConfigurationMode = 'ApplyAndMonitor'
RefreshMode = 'Push'
Debugmode = 'All'
RebootN... |
PowerShellCorpus/Github/ServiceDudes_cMDT/src/Examples/Deploy_MDT_Server.ps1 | Deploy_MDT_Server.ps1 | <#
$Modules =
@(
@{
Name = "xSmbShare"
RequiredVersion = "1.1.0.0"
},
@{
Name = "cNtfsAccessControl"
RequiredVersion = "1.3.0"
}
)
ForEach ($Module in $Modules)
{
If (-not((Get-DscResource -Module $Module.Name -Verbose:$False).Versi... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1484_AAA/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.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 u... |
PowerShellCorpus/Github/evgeniyosipov_ancbe/src/ANCBE/Properties/PublishProfiles/test publish-publish.ps1 | test publish-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'] = '4f2317b7-f01b-4c5... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_23_25_59_2/.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/liuguichao_Scrawler/ParkData/packages/Newtonsoft.Json.7.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/liuguichao_Scrawler/ParkData/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/liuguichao_Scrawler/ParkData/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/cogenta_Rackspace-HEAT/join_domain.ps1 | join_domain.ps1 | param (
[string]$domain,
[string]$oupath,
[string]$credential_username,
[string]$credential_password
)
# Set DNS Servers
Set-DnsClientServerAddress -InterfaceAlias "RC-FW-*" -ServerAddresses ("172.30.1.7","172.30.1.8")
# Create credentials
$secpasswd = ConvertTo-SecureString "$credential_... |
PowerShellCorpus/Github/mepples21_AzureScripts/Artifacts/Install-Exchange2013.ps1 | Install-Exchange2013.ps1 | # Install Exchange Server 2013
|
PowerShellCorpus/Github/mepples21_AzureScripts/Artifacts/Install-Exchange2016.ps1 | Install-Exchange2016.ps1 | # Install Exchange Server 2016 |
PowerShellCorpus/Github/mepples21_AzureScripts/Artifacts/Install-Exchange2010/Install-Exchange2010.ps1 | Install-Exchange2010.ps1 | # Install Exchange Server 2010 SP3
try {
Set-Location -Path C:\Install\Exchange2010SP3\
Setup.com /r:M,C,U,HT
}
catch {
Write-Error "Exchagne 2010 SP3 installation failed..."
}
# Install Exchange Server 2010 SP3 Update Rollup 14
try {
Set-Location -Path C:\Install\
.\Exchange2010-KB3151... |
PowerShellCorpus/Github/caiocardozo_NeyTech/NeyTechDDD/packages/jQuery.2.1.3/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/caiocardozo_NeyTech/NeyTechDDD/packages/jQuery.2.1.3/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/caiocardozo_NeyTech/NeyTechDDD/packages/jQuery.2.1.3/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/caiocardozo_NeyTech/NeyTechDDD/packages/EntityFramework.6.1.2/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
# MIIa2AYJKoZIhvcNAQcCoIIayTCCGsUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/caiocardozo_NeyTech/NeyTechDDD/packages/EntityFramework.6.1.2/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/caiocardozo_NeyTech/NeyTechDDD/packages/Newtonsoft.Json.6.0.8/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/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWin... |
PowerShellCorpus/Github/caiocardozo_NeyTech/NeyTechDDD/packages/Modernizr.2.8.3/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/caiocardozo_NeyTech/NeyTechDDD/packages/Modernizr.2.8.3/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/caiocardozo_NeyTech/NeyTechDDD/packages/Modernizr.2.8.3/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/JayGreentree_ActiveDirectoryUserProvisioning/New-NewPointeUser.ps1 | New-NewPointeUser.ps1 | New-Variable -Name NewFirstName
New-Variable -Name NewLastName
New-Variable -Name NewDisplayName
New-Variable -Name NewUserName
New-Variable -Name NewMI
New-Variable -Name NewWorkPhone
New-Variable -Name NewWorkPhoneE164
New-Variable -Name NewWorkPhoneLast4
New-Variable -Name NewMobilePhone
New-Variable -Name ... |
PowerShellCorpus/Github/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/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/lajos88_Strategy/Strategy/packages/EntityFramework.6.1.0/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
# MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/lajos88_Strategy/Strategy/packages/EntityFramework.6.1.0/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/Tanmaiye_TanmaiyeRepo0512211321/.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/chris18890_OLOM-Scripts/Scripts/Users.ps1 | Users.ps1 | "C:\Scripts\Prelim\DomainSetup.ps1"
cd "C:\Scripts\Staff\"
"C:\Scripts\Staff\CreateUsers.ps1"
cd "C:\Scripts\Students\"
"C:\Scripts\Students\CreateUsers.ps1"
|
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine3/dcpromo.ps1 | dcpromo.ps1 | $DNSName = $env:userdomain
$ComputerName = $env:computername
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools -ComputerName $ComputerName
Install-ADDSDomainController -Credential (Get-Credential $DNSName\Administrator) -DomainName "$DNSName" -InstallDns:$true -NoGlobalCatalog:$false -Force... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine3/setup.ps1 | setup.ps1 | $Machine = "$env:userdomain-dc3"
rename-computer $Machine
Cscript c:\windows\system32\SCRegEdit.wsf /ar 0
Cscript c:\windows\system32\scregedit.wsf /cs 1
$IPNet1 = "10.71.104"
$IPNetSite = "10.71.105"
$IPAddress = "$IPNetSite.2"
$Netmask = "21"
$GatewayAddress = "$IPNet1.1"
$DNSAddress = "$IPNet1.2"
G... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Prelim/DomainSetup.ps1 | DomainSetup.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Domain="$env:userdomain"
$ServerName="$env:computername"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuffix=$DNSSuf... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine1/dcpromo.ps1 | dcpromo.ps1 | $DNSName = "rmnetnt.local"
$ComputerName = $env:computername
Install-WindowsFeature -name AD-Domain-Services, FS-DFS-Namespace -IncludeManagementTools -ComputerName "$ComputerName"
Install-ADDSForest –DomainName "$DNSName" -ForestMode "Win2012R2"
|
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine1/setup-router.ps1 | setup-router.ps1 | $Machine = "mcb-rtr"
rename-computer $Machine
Cscript c:\windows\system32\SCRegEdit.wsf /ar 0
Cscript c:\windows\system32\scregedit.wsf /cs 1
$IPNet1 = "10.71.104"
$IPNetSite = $IPNet1
$IPAddress = "$IPNetSite.1"
$Netmask = "21"
$GatewayAddress = "$IPNet1.1"
$DNSAddress = "$IPNet1.2"
Get-NetAdapter -N... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine1/dhcp.ps1 | dhcp.ps1 | $Machine = "$env:computername"
$DNSName = "$env:userdomain.local"
$Netmask = "255.255.255.0"
$CDIR = "24"
$Router = "1"
$DNSServer = "2"
$StartRange = "10"
$EndRange = "254"
$IPNet = @("10.71.104", "10.71.105")
$Site = @("Site1", "Site2")
$IPAddress1 = $IPNet[0] + "." + $Router
$IPAddress2 = $IPNet[0] + "." ... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine1/setup.ps1 | setup.ps1 | $Machine = "hp-svr"
rename-computer $Machine
Cscript c:\windows\system32\SCRegEdit.wsf /ar 0
Cscript c:\windows\system32\scregedit.wsf /cs 1
$IPNet1 = "10.71.104"
$IPNetSite = $IPNet1
$IPAddress = "$IPNetSite.2"
$Netmask = "21"
$GatewayAddress = "$IPNet1.1"
$DNSAddress = $IPAddress
Get-NetAdapter -Nam... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine2/dcpromo.ps1 | dcpromo.ps1 | $DNSName = $env:userdomain
$ComputerName = $env:computername
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools -ComputerName $ComputerName
Install-ADDSDomainController -Credential (Get-Credential $DNSName\Administrator) -DomainName "$DNSName" -InstallDns:$true -NoGlobalCatalog:$false -Force... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Machine2/setup.ps1 | setup.ps1 | $Machine = "hp-svr-2"
rename-computer $Machine
Cscript c:\windows\system32\SCRegEdit.wsf /ar 0
Cscript c:\windows\system32\scregedit.wsf /cs 1
$IPNet1 = "10.71.104"
$IPNetSite = $IPNet1
$IPAddress = "$IPNetSite.3"
$Netmask = "21"
$GatewayAddress = "$IPNet1.1"
$DNSAddress = "$IPNet1.2"
Get-NetAdapter -... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Staff/ChangePassword.ps1 | ChangePassword.ps1 | $OU="Staff"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$OUPath="OU=$OU,$EndPath"
#get all enabled user accounts in the OU
$user = Get-ADUser -filter "enabled -eq 'true'" -SearchBase $OUPath -Properties * |
Select Name,SamAccountname,Surname,DistinguishedName,Departme... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Staff/CreateOneUser.ps1 | CreateOneUser.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Server= "$env:computername"
$OU="Staff"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuff... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Staff/CreateUsers.ps1 | CreateUsers.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Server= "$env:computername"
$OU="Staff"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuff... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Staff/CreateGroup.ps1 | CreateGroup.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuffix=$DNSSuffix
#===========================... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Students/ChangePassword.ps1 | ChangePassword.ps1 | $OU="Pupils"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$OUPath="OU=$OU,$EndPath"
#get all enabled user accounts in the OU
$user = Get-ADUser -filter "enabled -eq 'true'" -SearchBase $OUPath -Properties * |
Select Name,SamAccountname,Surname,DistinguishedName,Departm... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Students/CreateOneUser.ps1 | CreateOneUser.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Server= "$env:computername"
$OU="Pupils"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$Email... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Students/CreateUsers.ps1 | CreateUsers.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Server= "$env:computername"
$OU="Pupils"
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuf... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/Students/CreateGroup.ps1 | CreateGroup.ps1 | #=========================================
#Domain Names in ADS & DNS format, and main OU name
#=========================================
$Domain="$env:userdomain"
$DomainSuffix="local"
$EndPath="DC=$Domain,DC=$DomainSuffix"
$DNSSuffix="$Domain.$DomainSuffix"
$EmailSuffix=$DNSSuffix
#===========================... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/WDS/Win7ProX64ImageSetup.ps1 | Win7ProX64ImageSetup.ps1 | Import-WdsBootImage -Path "E:\Sources\boot.wim"
Import-WdsInstallImage -Path "E:\Sources\install.wim" -ImageName "Windows 7 Professional" -ImageGroup "Clients" -NewImageName "Windows 7 Professional x64" -UnattendFile "C:\Scripts\WDS\Win7ProX64Unattended.xml"
|
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/WDS/wds.ps1 | wds.ps1 | Install-WindowsFeature -name WDS -IncludeManagementTools
WDSUTIL /initialize-server /reminst:"D:\Reminst" /Authorize
Start-Service -displayname "Windows Deployment Services Server"
WDSUTIL /Set-Server /AnswerClients:all
WDSUTIL /Set-Server /NewMachineNamingPolicy:MCB-%#
New-WdsInstallImageGroup -Name "Cl... |
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/WDS/Win7ProX86ImageSetup.ps1 | Win7ProX86ImageSetup.ps1 | Import-WdsBootImage -Path "E:\Sources\boot.wim"
Import-WdsInstallImage -Path "E:\Sources\install.wim" -ImageName "Windows 7 Professional" -ImageGroup "Clients" -NewImageName "Windows 7 Professional x86" -UnattendFile "C:\Scripts\WDS\Win7ProX86Unattended.xml"
|
PowerShellCorpus/Github/chris18890_OLOM-Scripts/Scripts/WDS/Server2012ImageSetup.ps1 | Server2012ImageSetup.ps1 | Import-WdsBootImage -Path "E:\Sources\boot.wim"
Import-WdsInstallImage -Path "E:\Sources\install.wim" -ImageName "Windows Server 2012 R2 SERVERDATACENTER" -ImageGroup "Servers" -NewImageName "Server 2012 Datacenter" -UnattendFile "C:\Scripts\WDS\Server2012Unattended.xml"
Import-WdsInstallImage -Path "E:\Sources\ins... |
PowerShellCorpus/Github/Scriptyrium_TestRepo/Get-Subnet.ps1 | Get-Subnet.ps1 | rest
Function Get-Subnet(
[Parameter(Mandatory=$True,Position=1)][string]$IP,
[Parameter(Mandatory=$True,Position=2)][string]$Mask
)
{
<#
.Synopsis
Gives subnet information based on IP and subnetmask.
.DESCRIPTION
Lange Beschreibung
.EXAMPLE
Get-Subnet -IP 1.2.3.4 -Mask 255.255.255.0
... |
PowerShellCorpus/Github/dunderrrrrr_wcryptProfit/wcryptProfit.ps1 | wcryptProfit.ps1 | $blockchainUri = "https://blockchain.info/address/"
$wallets = @("12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw","115p7UMMngoj1pMvkpHijcRdfJNXj6LrLn","13AM4VW2dhxYgXeQepoHkHSQuy6NgaEb94","1QAc9S5EmycqjzzWDc1yiWzr9jJLC8sLiY","15zGqZCTcys6eCjDkE3DypCjXi6QWRV6V1")
$btctotal = 0;
foreach ($wallet in $wallets) {
$fetchUri = $bl... |
PowerShellCorpus/Github/jgeater_Fix-BCD/Fix-BCD.ps1 | Fix-BCD.ps1 | #This script will remove all but the current boot Firmware.
#Mutiple boot firmware entries has been known to cause slow boots and failure to boot from a USB drive
#This script requires admin rights.
Function Get-BCDObject()
{
$bcdEntries = bcdedit /enum firmware
$bcdObject = @()
foreach ($bcdEntry in... |
PowerShellCorpus/Github/markrui3_Helper/chat/chat/AppPackages/chat_1.1.0.1_AnyCPU_Test/Add-AppDevPackage.ps1 | Add-AppDevPackage.ps1 | #
# Add-AppxDevPackage.ps1 is a PowerShell script designed to install app
# packages created by Visual Studio for developers. To run this script from
# Explorer, right-click on its icon and choose "Run with PowerShell".
#
# Visual Studio supplies this script in the folder generated with its
# "Prepare Package" c... |
PowerShellCorpus/Github/markrui3_Helper/chat/chat/AppPackages/chat_1.1.0.0_AnyCPU_Test/Add-AppDevPackage.ps1 | Add-AppDevPackage.ps1 | #
# Add-AppxDevPackage.ps1 is a PowerShell script designed to install app
# packages created by Visual Studio for developers. To run this script from
# Explorer, right-click on its icon and choose "Run with PowerShell".
#
# Visual Studio supplies this script in the folder generated with its
# "Prepare Package" c... |
PowerShellCorpus/Github/MicrosoftDocs_E2E_Test_TrsfertoDocs1/.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/stiefali_sharepoint-upload/sharePointUpload.ps1 | sharePointUpload.ps1 | #How do use this script
#Enter parameters in Param
# $SiteUrl - the url for the sharpoint-side
# eg. http://<server>/sites/<userName" for the local sharepoint-site
# $File - path to the Share.app (fullPath including file-name)
# $DocLibName - Name of the sharepoint list where the file should be added... |
PowerShellCorpus/Github/MicrosoftDocs_nav-content.de-ch/.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/Adobe-CloudOps_Adobe-Chef/chef-run-windows.ps1 | chef-run-windows.ps1 | # Filename:: chef-run-windows.ps1
# Author:: Tim Prendergast (<tprender@adobe.com>, @auxome)
# Copyright:: Copyright © 2013 Adobe Systems Incorporated
# License:: Apache License, Version 2.0
# Description:: OpsCode Chef Bootstrap Script for Windows Instances in AWS
# Notes:: At this time, AWS SDK built into images... |
PowerShellCorpus/Github/SitecorePowerShell_SPE-FileExplorer/FileExplorer/App.ps1 | App.ps1 | #region Dialog Setup
$accelerator = [PSObject].Assembly.GetType("System.Management.Automation.TypeAccelerators")
Add-Type -AssemblyName PresentationCore, PresentationFramework -PassThru | Where-Object IsPublic | ForEach-Object { $accelerator::Add($_.Name,$_) }
$currentDirectory = Split-Path $script:MyInvocation.My... |
PowerShellCorpus/Github/andbron_karlkuhnhausen/runbooks/PolicyDefinitionManagementSample1.ps1 | PolicyDefinitionManagementSample1.ps1 | <#
.DESCRIPTION
An example runbook which gets lists all policy definitions across subscriptions using the Run As Account (Service Principal)
.NOTES
AUTHOR: Karl Kuhnhausen
LASTEDIT: July 27, 2016
#>
$connectionName = "AzureRunAsConnection"
try
{
# Get the connection "Az... |
PowerShellCorpus/Github/andbron_karlkuhnhausen/runbooks/AzureAutomationTutorialScript.ps1 | AzureAutomationTutorialScript.ps1 | <#
.DESCRIPTION
An example runbook which gets all the ARM resources using the Run As Account (Service Principal)
.NOTES
AUTHOR: Azure Automation Team
LASTEDIT: Mar 14, 2016
#>
$connectionName = "AzureRunAsConnection"
try
{
# Get the connection "AzureRunAsConnection "
... |
PowerShellCorpus/Github/andbron_karlkuhnhausen/rbac/ES-Role-Definitions.ps1 | ES-Role-Definitions.ps1 | Write-OutPut "Adding group to contributor role" -ForegroundColor Green
New-AzureRmRoleAssignment -Scope $scope `
-RoleDefinitionName "Contributor" `
-ObjectId $groupObjectId
|
PowerShellCorpus/Github/andbron_karlkuhnhausen/scripts/file.ps1 | file.ps1 | # Placeholder PowerShell file.
|
PowerShellCorpus/Github/ugok_First/first/nba parse.ps1 | nba parse.ps1 | $path = "25 Jack.html"
$final = @("")* 25
$source = @("")* 25
$f = select-string -path $path -pattern "<p>"
for ($i = 1; $i -lt 26; $i++){
$f = select-string -path $path -pattern ("<p>" + $i + "\. ")
$temp = ([string]$i + "\. ")
$temp = $f -split ($temp)
$temp = $temp[1].replace("’","'")
$temp =... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/profile.ps1 | profile.ps1 | # HOME
######
# Set HOME
if (!$Env:HOME) { $Env:HOME = "$Env:USERPROFILE" }
(get-psprovider 'FileSystem').home = $Env:HOME
$Env:TERMINUS_DIR = "$Env:ConEmuDir"
if (-not (Test-Path ($Env:HOME + "\.terminus"))) {
New-Item ($Env:HOME + "\.terminus") -type directory
}
# Git
#####
# See vendor\git-for-windo... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/PSReadLine/SamplePSReadlineProfile.ps1 | SamplePSReadlineProfile.ps1 |
# This is an example profile for PSReadline.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
Import-Module PSReadLine
Set-PSReadLineOption -EditMode Emacs
# Searching for commands with up/down arrow is really hand... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/TortoiseGit.ps1 | TortoiseGit.ps1 | # TortoiseGit
function private:Get-TortoiseGitPath {
if ((Test-Path "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe") -eq $true) {
# TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc.
return "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe"
}
return "C:\Program Files\Tortoise... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/CheckVersion.ps1 | CheckVersion.ps1 | $Global:GitMissing = $false
if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) {
Write-Warning "git command could not be found. Please create an alias or add it to your PATH."
$Global:GitMissing = $true
return
}
$requiredVersion = [Version]'1.7.2'
if ((git --version 2> $null) -ma... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/Utils.ps1 | Utils.ps1 | # General Utility Functions
function Invoke-NullCoalescing {
$result = $null
foreach($arg in $args) {
if ($arg -is [ScriptBlock]) {
$result = & $arg
} else {
$result = $arg
}
if ($result) { break }
}
$result
}
Set-Alias ?? Invoke-N... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/GitPrompt.ps1 | GitPrompt.ps1 | # Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
$global:GitPromptSettings = New-Object PSObject -Property @{
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor
BeforeText = ' ['
... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/GitUtils.ps1 | GitUtils.ps1 | # Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
function Get-GitDirectory {
if ($Env:GIT_DIR) {
$Env:GIT_DIR
} else {
Get-LocalOrParentPath .git
}
}
function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.S... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/profile.example.ps1 | profile.example.ps1 | Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# Load posh-git module from current directory
Import-Module .\posh-git
# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-git
# Set... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/install.ps1 | install.ps1 | param([switch]$WhatIf = $false)
if($PSVersionTable.PSVersion.Major -lt 2) {
Write-Warning "posh-git requires PowerShell 2.0 or better; you have version $($Host.Version)."
return
}
if(!(Test-Path $PROFILE)) {
Write-Host "Creating PowerShell profile...`n$PROFILE"
New-Item $PROFILE -Force -Type ... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/GitTabExpansion.ps1 | GitTabExpansion.ps1 | # Initial implementation by Jeremy Skinner
# http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/
$Global:GitTabSettings = New-Object PSObject -Property @{
AllCommands = $false
}
$subcommands = @{
bisect = 'start bad good skip reset visualize replay log run'
notes = 'edit ... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/chocolatey/tests/InstallChocolatey.Tests.ps1 | InstallChocolatey.Tests.ps1 | $packageName = "poshgit"
cpack
function Setup-Environment {
Cleanup
$env:poshGit = join-path (Resolve-Path .\Tests ) dahlbyk-posh-git-60be436.zip
$profileScript = "function Prompt(){ `$host.ui.RawUI.WindowTitle = `"My Prompt`" }"
(Set-Content $Profile -value $profileScript -Force)
}
function... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/posh-git/chocolatey/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | function Insert-Script([ref]$originalScript, $script) {
if(!($originalScript.Value -Contains $script)) { $originalScript.Value += $script }
}
try {
$binRoot = join-path $env:systemdrive 'tools'
$oldPromptOverride = "if(Test-Path Function:\Prompt) {Rename-Item Function:\Prompt PrePoshGitPrompt -Force}... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/PsTerminus/go.ps1 | go.ps1 | $Global:GoDataDirectory = "$([Environment]::GetFolderPath('LocalApplicationData'))\Go\"
$Global:GoRememberFileName = "rememberLast.txt"
$Global:GoBookmarkFileName = "go.txt"
function go([string]$key, [string]$selectedPath = "", [switch]$help, [switch]$h, [switch]$add, [switch]$a, [switch]$delete, [switch]$d, [swit... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/PsTerminus/cdplus.ps1 | cdplus.ps1 | function Push-Directory ($newLocation) {
$newLocation = Get-Item -force $newLocation;
$global:CD_COMMAND_HISTORY_LIST.Insert(0, $(Get-Location))
Push-Location $newLocation
}
function Get-CommandList () {
$global:CD_COMMAND_HISTORY_LIST
}
function Show-HistoryDirectory ($ShowCount) {
if(... |
PowerShellCorpus/Github/narnaud_terminus/settings/powershell/modules/PsTerminus/prompt.ps1 | prompt.ps1 | $s = New-Object PSObject -Property @{
Clean = "white"
Dirty = "red"
NoStatus = "cyan"
}
function Get-LocalOrParentPath($path) {
$checkIn = Get-Item -Force .
if ($checkIn.PSProvider.Name -ne 'FileSystem') {
return $null
}
while ($checkIn -ne $NULL) {
$path... |
PowerShellCorpus/Github/narnaud_terminus/scripts/utils.ps1 | utils.ps1 | function Ensure-Exists ($path) {
if (-not (Test-Path $path)) {
Write-Error "Missing required $path! Ensure it is installed"
exit 1
}
return $true > $null
}
function Ensure-Executable ($command) {
try { Get-Command $command -ErrorAction Stop > $null }
catch {
If( (... |
PowerShellCorpus/Github/narnaud_terminus/scripts/pack.ps1 | pack.ps1 | <#
.Synopsis
Pack cmder
.DESCRIPTION
Use this script to pack cmder into release archives
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
Then unblock the script for execution with UnblockFile .\pack.ps1
.EXAMPLE
.\pack.ps1
Cr... |
PowerShellCorpus/Github/narnaud_terminus/scripts/build.ps1 | build.ps1 | <#
.Synopsis
Build terminus
.DESCRIPTION
Use this script to build your own edition of terminus
This script builds dependencies from current vendor/sources.json file and unpacks them.
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
... |
PowerShellCorpus/Github/rupeshray_SmartSchool/SmartSchool/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.