full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Create Pages/PnP_CreatePage.ps1 | PnP_CreatePage.ps1 | # Script to create TermGroup, TermSets and Terms in TermStore
# Requires PnP Package with SP Online Management Shell | Details @ https://github.com/SharePoint/PnP-PowerShell
# By: Bipul Raman
Clear-Host
Connect-PnPOnline -Url https://spointpratice.sharepoint.com/sites/Intranet
Import-Csv .\Pnp_CreatePageData.c... |
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Create SiteColumns/PnP_CreateSiteColumns.ps1 | PnP_CreateSiteColumns.ps1 | # Script to create SiteColumns in a a group
# Requires PnP Package with SP Online Management Shell | Details @ https://github.com/SharePoint/PnP-PowerShell
# By: Bipul Raman
Clear-Host
Connect-PnPOnline -Url https://spointpratice.sharepoint.com/sites/Intranet
#Add-PnPField -DisplayName "Test Location" -InternalN... |
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Add WebPart On WikiPage/PnPAddWebPartOnWikiPage.ps1 | PnPAddWebPartOnWikiPage.ps1 | # Script to create TermGroup, TermSets and Terms in TermStore
# Requires PnP Package with SP Online Management Shell | Details @ https://github.com/SharePoint/PnP-PowerShell
# By: Bipul Raman .
Clear-Host
Connect-PnPOnline -Url https://bipulraman.sharepoint.com
Add-PnPWebPartToWikiPage -ServerRelativePageUrl "... |
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Create Managed MetaData/CreateManagedMetaData.ps1 | CreateManagedMetaData.ps1 | #Please install the SharePoint client components SDK � http://www.microsoft.com/en-us/download/details.aspx?id=35585 prior to running this script.
# By: Bipul Raman
Clear-Host
#Specify tenant admin and URL
$User = "admin@bipulraman.onmicrosoft.com"
$Site = "https://bipulraman.sharepoint.com"
[XML]$Import = Get-... |
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Create SubSites/PnP_CreateSubSites.ps1 | PnP_CreateSubSites.ps1 | # Script to create Subsites
# Requires PnP Package with SP Online Management Shell | Details @ https://github.com/SharePoint/PnP-PowerShell
# By: Bipul Raman
Clear-Host
Connect-PnPOnline -Url https://spointpratice.sharepoint.com/sites/Intranet
New-PnPWeb -Title "Blog" -Url "Blog" -Description "Blog" -Locale 1033... |
PowerShellCorpus/Github/bipulraman_PowerShell-Automation-for-SharePoint-Online/Create TermStore and Terms/PnP_CreateTermStore.ps1 | PnP_CreateTermStore.ps1 | # Script to create TermGroup, TermSets and Terms in TermStore
# Requires PnP Package with SP Online Management Shell | Details @ https://github.com/SharePoint/PnP-PowerShell
# By: Bipul Raman
Clear-Host
Connect-PnPOnline -Url https://bipulraman.sharepoint.com
#Export-PnPTermGroupToXml -Out D:\MMSoutput.xml
Impo... |
PowerShellCorpus/Github/satj86_selene/install-java.ps1 | install-java.ps1 | Start-Process "jre-8u131-windows-x64.exe" -ArgumentList "/s" -wait -NoNewWindow |
PowerShellCorpus/Github/satj86_selene/provision-node.ps1 | provision-node.ps1 | #################################################################################################################################
# Name : Configure-WinRM.ps1 #
# ... |
PowerShellCorpus/Github/satj86_selene/install-chrome.ps1 | install-chrome.ps1 | Start-Process msiexec -ArgumentList "/q", "/I", "googlechromestandaloneenterprise64.msi" -wait |
PowerShellCorpus/Github/tomascw_chocoapps/peerunity/tools/chocolateyuninstall.ps1 | chocolateyuninstall.ps1 | # IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file:
# $f='c:\path\to\thisFile.ps1'
# gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f
## NOTE: In 80-90% of the c... |
PowerShellCorpus/Github/tomascw_chocoapps/peerunity/tools/chocolateyinstall.ps1 | chocolateyinstall.ps1 | # IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file:
# $f='c:\path\to\thisFile.ps1'
# gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f
$ErrorActionPreference = 'S... |
PowerShellCorpus/Github/tomascw_chocoapps/peerunity/tools/chocolateybeforemodify.ps1 | chocolateybeforemodify.ps1 | # This runs in 0.9.10+ before upgrade and uninstall.
# Use this file to do things like stop services prior to upgrade or uninstall.
# NOTE: It is an anti-pattern to call chocolateyUninstall.ps1 from here. If you
# need to uninstall an MSI prior to upgrade, put the functionality in this
# file without calling the ... |
PowerShellCorpus/Github/tomascw_chocoapps/firestorm/tools/chocolateyuninstall.ps1 | chocolateyuninstall.ps1 |
$ErrorActionPreference = 'Stop';
$packageName = 'firestorm'
$softwareName = 'firestorm*'
$installerType = 'EXE'
$silentArgs = '/qn /norestart'
$validExitCodes = @(0, 3010, 1605, 1614, 1641)
if ($installerType -ne 'MSI') {
$validExitCodes = @(0)
}
$uninstalled = $false
[array]$key = Get-Unin... |
PowerShellCorpus/Github/tomascw_chocoapps/firestorm/tools/chocolateyinstall.ps1 | chocolateyinstall.ps1 |
$ErrorActionPreference = 'Stop';
$packageName= 'firestorm'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'http://downloads.firestormviewer.org/windows/Phoenix-FirestormOS-Release-5-0-1-52150_Setup.exe'
$url64 = 'http://downloads.firestormviewer.org/windows/Phoen... |
PowerShellCorpus/Github/tomascw_chocoapps/firestorm/tools/chocolateybeforemodify.ps1 | chocolateybeforemodify.ps1 | |
PowerShellCorpus/Github/tomascw_chocoapps/alchemy/tools/chocolateyuninstall.ps1 | chocolateyuninstall.ps1 | $ErrorActionPreference = 'Stop';
$packageName = 'alchemy'
$softwareName = 'alchemy*'
$installerType = 'EXE'
$silentArgs = '/qn /norestart'
$validExitCodes = @(0, 3010, 1605, 1614, 1641)
if ($installerType -ne 'MSI') {
$validExitCodes = @(0)
}
$uninstalled = $false
[array]$key = Get-UninstallRegis... |
PowerShellCorpus/Github/tomascw_chocoapps/alchemy/tools/chocolateyinstall.ps1 | chocolateyinstall.ps1 |
$ErrorActionPreference = 'Stop';
$packageName= 'alchemy'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://depot.alchemyviewer.org/pub/windows/release/Alchemy_4_0_0_37571_i686_Setup.exe'
$url64 = 'https://depot.alchemyviewer.org/pub/windows64/release/Alchem... |
PowerShellCorpus/Github/tomascw_chocoapps/alchemy/tools/chocolateybeforemodify.ps1 | chocolateybeforemodify.ps1 | # This runs in 0.9.10+ before upgrade and uninstall.
# Use this file to do things like stop services prior to upgrade or uninstall.
# NOTE: It is an anti-pattern to call chocolateyUninstall.ps1 from here. If you
# need to uninstall an MSI prior to upgrade, put the functionality in this
# file without calling the ... |
PowerShellCorpus/Github/zvolkov_sqlDeploy/deployFromTFS.ps1 | deployFromTFS.ps1 | param (
[string] $path = ".",
[string] $server = "(localdb)\v11.0",
[string] $database = "Test",
[switch] $strict,
[string] $tfsUrl = "http://tfs.niaid.nih.gov:8080/tfs",
[string] $tfsPath = "$/CustomDevelopment/NEAR/Database/Deltas/NEAR 2.5.0",
[string] $pathToTFexe = "C:\Program Files (x86)\Microsoft Vi... |
PowerShellCorpus/Github/oze4_PoSH-Runspace---LoadingBox/Show-LoadingBox.ps1 | Show-LoadingBox.ps1 | FUNCTION Show-LoadingBox
{
$Script:Hash = [Hashtable]::Synchronized(@{})
$Script:Hash.IsRunning = $true
$RunSpace = [Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace()
$RunSpace.ApartmentState = "STA"
$RunSpace.ThreadOptions = "ReuseThread"
$RunSpace.Open()
$RunSpace.... |
PowerShellCorpus/Github/oze4_PoSH-Runspace---LoadingBox/Log-ToLoadingBox.ps1 | Log-ToLoadingBox.ps1 | FUNCTION Log-ToLoadingBox ($Message) {
IF($Script:Hash.IsRunning -eq $true)
{
$Script:Hash.STATUS.Text = $Message
}
} |
PowerShellCorpus/Github/oze4_PoSH-Runspace---LoadingBox/Close-LoadingBox.ps1 | Close-LoadingBox.ps1 | FUNCTION Close-LoadingBox {
$null = $Runspace.Dispose()
$null = $Script:Hash.LoadForm.Close()
} |
PowerShellCorpus/Github/gogosub77_Powershell.Items/SVF_FILEDATE_DELTE.ps1 | SVF_FILEDATE_DELTE.ps1 | #SVFのデータファイルを作成から5時間以上経過したものを削除する。
#事前にSet-ExecutionPolicy RemoteSignedを実行する。一度だけ。
$a = Get-ChildItem D:\*******\CTEC_?_R*.csv
foreach($x in $a)
{
$xtime = $x.LastWriteTime.AddHours(5) #5hour set
#$x1 = $x.LastWriteTime.Minute(5)
if ((Get-Date) -ge $xtime){
#{$x.Delete()}
... |
PowerShellCorpus/Github/OpenLocalizationTestOrg_azure-docs-pr6_fr-FR/.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/KirkMunro_TypePx/snippets/Dictionary.AddArrayItem.ps1 | Dictionary.AddArrayItem.ps1 | <#
.SYNOPSIS
Add an item to one or more keys as an array stored in a dictionary
.DESCRIPTION
Add an item to one or more keys as an array stored in a dictionary. If the value is not an array or if the key does not yet exist in the dictionary, create the array from what is currently stored and add the item to... |
PowerShellCorpus/Github/KirkMunro_TypePx/snippets/Dictionary.AddListItem.ps1 | Dictionary.AddListItem.ps1 | <#
.SYNOPSIS
Add an item to one or more keys as a list stored in a dictionary
.DESCRIPTION
Add an item to one or more keys as a list stored in a dictionary. If the key does not yet exist in the dictionary, add it. Otherwise, concatenate the list to the current list.
#>
[System.Diagnostics.DebuggerHidden()... |
PowerShellCorpus/Github/KirkMunro_TypePx/snippets/String.ToScriptBlock.ps1 | String.ToScriptBlock.ps1 | <#
.SYNOPSIS
Convert a string into a script block
.DESCRIPTION
Convert a string into a script block, optionally using a set of variable values that will be applied to the string before the conversion.
#>
[System.Diagnostics.DebuggerHidden()]
param(
# The string you are converting to a script block.
... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/numerics.ps1 | numerics.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/string.ps1 | string.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/enumerable.ps1 | enumerable.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/dictionary.ps1 | dictionary.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/array.ps1 | array.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/securestring.ps1 | securestring.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/datetime.ps1 | datetime.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/psmoduleinfo.ps1 | psmoduleinfo.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/typedata/psscriptcmdlet.ps1 | psscriptcmdlet.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/helpers/Add-ScriptPropertyData.ps1 | Add-ScriptPropertyData.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/helpers/Add-AliasPropertyData.ps1 | Add-AliasPropertyData.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/helpers/Add-ScriptMethodData.ps1 | Add-ScriptMethodData.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/functions/Use-Namespace.ps1 | Use-Namespace.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/functions/Add-TypeAccelerator.ps1 | Add-TypeAccelerator.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/functions/Remove-TypeAccelerator.ps1 | Remove-TypeAccelerator.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/functions/Set-TypeAccelerator.ps1 | Set-TypeAccelerator.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/KirkMunro_TypePx/functions/Get-TypeAccelerator.ps1 | Get-TypeAccelerator.ps1 | <#############################################################################
The TypePx module adds properties and methods to the most commonly used types
to make common tasks easier. Using these type extensions together can provide
an enhanced syntax in PowerShell that is both easier to read and
self-documenting... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker.settings.ps1 | PSHitchhiker.settings.ps1 | ###############################################################################
# Customize these properties and tasks
###############################################################################
param(
$Artifacts = './artifacts',
$ModuleName = 'PSHitchhiker',
$ModulePath = './PSHitchhiker',
$... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker.build.ps1 | PSHitchhiker.build.ps1 | # Include: Settings
. './PSHitchhiker.settings.ps1'
# Include: build_utils
. './build_utils.ps1'
# Synopsis: Run/Publish Tests and Fail Build on Error
task Test BeforeTest, RunTests, ConfirmTestsPassed, AfterTest
# Synopsis: Run full Pipleline.
task . Clean, Analyze, Test, Archive, Publish
# Synopsis: I... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/build_utils.ps1 | build_utils.ps1 | <#
.SYNOPSIS
Publishes a PowerShell Module to a Network Share.
.Example
$ModuleInfo = @{
RepoName = 'PoshRepo'
RepoPath = '\\server\PoshRepo'
ModuleName = 'BuildHelpersTest'
ModulePath = '.\BuildHelpersTest.psd1'
}
Publish-SMBModule @ModuleInfo
#>
func... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/tests/private/Ask.tests.ps1 | Ask.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
# Since we match the srs/tests organization this works
$here = $here -replace 'tests', 'PSHitchhiker'
. "$here\$sut"
# Import our module to use InModuleScope
Import-Module... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/tests/private/Get-RandomQuote.tests.ps1 | Get-RandomQuote.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
#since we match the srs/tests organization this works
$here = $here -replace 'tests', 'PSHitchhiker'
. "$here\$sut"
# Import our module to use InModuleScope
Import-Module ... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/tests/private/Get-RomanNumeral.tests.ps1 | Get-RomanNumeral.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$here = $here -replace 'tests', 'PSHitchhiker'
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. "$here\$sut"
Describe "Get-RomanNumeral" {
Context "Simple Calculations" {
It "Calculates the Roman Numeral for 1" {... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/tests/public/Invoke-PSHitchhiker.tests.ps1 | Invoke-PSHitchhiker.tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
#since we match the srs/tests organization this works
$here = $here -replace 'tests', 'PSHitchhiker'
. "$here\$sut"
# Import our module to use InModuleScope
Import-Module ... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker/private/Get-RomanNumeral.ps1 | Get-RomanNumeral.ps1 | function Get-RomanNumeral($Number)
{
$lookup = [ordered]@{
1000 = "M"
900 = "CM"
500 = "D"
400 = "CD"
100 = "C"
90 = "XC"
50 = "L"
40 = "XL"
10 = "X"
9 = "IX"
5 = "V"
4 = "IV"
... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker/private/Ask.ps1 | Ask.ps1 | function Ask
{
[cmdletbinding()]
param(
[parameter(Mandatory = $False)]
[string] $Question,
[parameter(Mandatory = $False)]
[string] $Format = "string"
)
if($Question -in ($null, ""))
{
return "Please ask a question."
}
$UltimateQuesti... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker/private/Help.ps1 | Help.ps1 | function Help()
{
#TODO:
"Get-Help | Module"
} |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker/private/Get-RandomQuote.ps1 | Get-RandomQuote.ps1 | function Get-RandomQuote
{
$quotes =
"Don't Panic.",
"Would it save you a lot of time if I just gave up and went mad now?",
"Time is an illusion. Lunchtime doubly so.",
"Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?"... |
PowerShellCorpus/Github/Xainey_PSHitchhiker/PSHitchhiker/public/Invoke-PSHitchHiker.ps1 | Invoke-PSHitchHiker.ps1 | <#
.SYNOPSIS
Asks DeepThought a Question.
.DESCRIPTION
Asks DeepThought a Question.
You can ask questions and request a specific return format.
.PARAMETER Ask
You can ask questions and request a specific return format.
.PARAMETER Help
Just a minor w... |
PowerShellCorpus/Github/wayneg123_cmder_config/user-profile.ps1 | user-profile.ps1 | # Use this file to run your own startup commands
## Prompt Customization
<#
.SYNTAX
<PrePrompt><CMDER DEFAULT>
λ <PostPrompt> <repl input>
.EXAMPLE
<PrePrompt>N:\Documents\src\cmder [master]
λ <PostPrompt> |
#>
[ScriptBlock]$PrePrompt = {
}
# Replace the cmder prompt entirely with th... |
PowerShellCorpus/Github/superyyrrzz_TestNewRepo3/.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/thephoton_ransomware/updatefilescreen.ps1 | updatefilescreen.ps1 | #This script updates the 'known ransomware files' file screen group using content from this github repo
$decryptreadme = (Invoke-WebRequest "https://raw.githubusercontent.com/thephoton/ransomware/master/filescreendecryptreadme.txt").Content
$fileexts = (Invoke-WebRequest "https://raw.githubusercontent.com/thephoton... |
PowerShellCorpus/Github/lsgroi_Pask.ExtensionProjectTemplate/Pask.ps1 | Pask.ps1 | <#
.SYNOPSIS
Modular task-oriented PowerShell build automation for .NET
.DESCRIPTION
This command invokes a set of PowerShell build automation tasks.
.LINK
https://github.com/lsgroi/Pask
https://github.com/nightroman/Invoke-Build
.PARAMETER Task
One or more tasks to be invoked.
Special task '?' would li... |
PowerShellCorpus/Github/lsgroi_Pask.ExtensionProjectTemplate/.build/build.ps1 | build.ps1 | Set-Property GitHubOwner -Value "lsgroi"
Set-Property GitHubRepo -Value $ProjectName
Set-Property ReleaseAssetPattern -Value "Pask.ExtensionProjectTemplate"
Import-Task Restore-NuGetPackages, Clean, Build, Version-Assemblies, Version-BuildServer, New-GitHubRelease
Set-Property BuildConfiguration -Value Release
... |
PowerShellCorpus/Github/lsgroi_Pask.ExtensionProjectTemplate/.build/scripts/Pask.ps1 | Pask.ps1 | <#
.SYNOPSIS
This script defines a collection of code snippets used by Pask
.PARAMETER BuildProperties <System.Collections.Specialized.OrderedDictionary>
The build properties in scope
The order in which the properties are added is important to maintain consistency when they are being updated
.PARAM... |
PowerShellCorpus/Github/lsgroi_Pask.ExtensionProjectTemplate/Pask.ExtensionProjectTemplate/tools/Init.ps1 | Init.ps1 | # This script runs:
# - the first time a package is installed in a solution
# - every time the solution is opened (Package Manager Console window has to be open at the same time for the script to run)
param($InstallPath, $ToolsPath, $Package, $Project)
if ($Project -eq $null) {
# Solution level packages ar... |
PowerShellCorpus/Github/lsgroi_Pask.ExtensionProjectTemplate/Pask.ExtensionProjectTemplate/init/.build/build.ps1 | build.ps1 | Import-Task Clean, Pack-Nuspec, Test-Pester, Push-Local, Version-BuildServer, Push
# Synopsis: Default task
Task . Clean, Pack-Nuspec, Test, Push-Local
# Synopsis: Run all automated tests
Task Test Pack-Nuspec, Test-Pester
# Synopsis: Release task
Task Release Version-BuildServer, Clean, Pack-Nuspec, Test, ... |
PowerShellCorpus/Github/MCLD_gra-redeploy/deploy-gra.ps1 | deploy-gra.ps1 | robocopy /s C:\deployments\gra c:\inetpub\gra
robocopy /s c:\gra\preserved-files\AvatarCache c:\inetpub\gra\images\AvatarCache
robocopy /s c:\gra\preserved-files\AvatarParts c:\inetpub\gra\images\AvatarParts
robocopy /s c:\gra\preserved-files\Badges c:\inetpub\gra\images\Badges
robocopy /s c:\gra\preserved-files\... |
PowerShellCorpus/Github/MCLD_gra-redeploy/preserve-and-prep.ps1 | preserve-and-prep.ps1 | # expectations:
# live GRA site is in c:\inetpub\gra
# deployed site is in c:\deployments
# folder exists to preserve files between deployments at c:\gra\preserved-files
# favicon assets exist in c:\gra\preserved-files\static-site
# customized CR logo files (gra150.png, gra300.png) exist in c:\gra\preserved-files\... |
PowerShellCorpus/Github/MSUDenverSystemsEngineering_MoveComputerAD/Deploy-Application.ps1 | Deploy-Application.ps1 | <#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall" deployment type.
The install deploymen... |
PowerShellCorpus/Github/MSUDenverSystemsEngineering_MoveComputerAD/AppDeployToolkit/AppDeployToolkitExtensions.ps1 | AppDeployToolkitExtensions.ps1 | <#
.SYNOPSIS
This script is a template that allows you to extend the toolkit with your own custom functions.
.DESCRIPTION
The script is automatically dot-sourced by the AppDeployToolkitMain.ps1 script.
.NOTES
Toolkit Exit Code Ranges:
60000 - 68999: Reserved for built-in exit codes in Deploy-Applicatio... |
PowerShellCorpus/Github/MSUDenverSystemsEngineering_MoveComputerAD/AppDeployToolkit/AppDeployToolkitMain.ps1 | AppDeployToolkitMain.ps1 | <#
.SYNOPSIS
This script contains the functions and logic engine for the Deploy-Application.ps1 script.
.DESCRIPTION
The script can be called directly to dot-source the toolkit functions for testing, but it is usually called by the Deploy-Application.ps1 script.
The script can usually be updated to the latest versio... |
PowerShellCorpus/Github/MSUDenverSystemsEngineering_MoveComputerAD/AppDeployToolkit/AppDeployToolkitHelp.ps1 | AppDeployToolkitHelp.ps1 | <#
.SYNOPSIS
Displays a graphical console to browse the help for the App Deployment Toolkit functions
.DESCRIPTION
Displays a graphical console to browse the help for the App Deployment Toolkit functions
.EXAMPLE
AppDeployToolkitHelp.ps1
.NOTES
.LINK
http://psappdeploytoolkit.com
#>
##*================... |
PowerShellCorpus/Github/MSUDenverSystemsEngineering_MoveComputerAD/Tests/PSScriptAnalyzer.tests.ps1 | PSScriptAnalyzer.tests.ps1 | Describe 'Testing against PSScriptAnalyzer rules' {
Context 'PSScriptAnalyzer Standard Rules' {
$analysis = Invoke-ScriptAnalyzer -Path 'Deploy-Application.ps1'
$scriptAnalyzerRules = Get-ScriptAnalyzerRule
forEach ($rule in $scriptAnalyzerRules) {
It "Should pass $rule" {
If ($analysis.RuleName -co... |
PowerShellCorpus/Github/Tron12345_githubtest/githubtest.ps1 | githubtest.ps1 | param($variabletest)
write-host "this is a gittttttttthub test..........on the 7/6/14 21.20 You are a $variabletest"
|
PowerShellCorpus/Github/xlegend1024_AZ-VMSS-WIN-CUSTSCREXT/lge-vmss-from-image.ps1 | lge-vmss-from-image.ps1 | param(
$ResourceGroupName,
$noVM=400,
$storageSKU='Standard_LRS',
$location = 'koreasouth',
#$imageuri='https://juleekoreasouth.blob.core.windows.net/vmimage/image.vhd',
#$imagekey='PRwy2N982rc4m3ZzF0LWv/Sp/Ik6Bp5WtEpPy6CY75XrIEhCLJdhybAPRprlgLbTEdZ8J3dL77yDTV/p3hq0VQ==',
#$imageSAresourcegroup='service-demo-kor... |
PowerShellCorpus/Github/xlegend1024_AZ-VMSS-WIN-CUSTSCREXT/InstAgent.ps1 | InstAgent.ps1 | Param(
[string] $workspaceid,
[string] $key
)
#need id and key like following
$workspaceid='d2710c19-0e42-4079-a731-b7cd5bf3fb05'
$key='9UWx7FssTv4XCwHp7igTIFcANjQdSD9mtYtC/wVOVfYf/bLikIOYod7dZBP2z+Sa96SdY8XD6XXdlpB1E8K3pA=='
$omsagenturl='http://go.microsoft.com/fwlink/?LinkID=517476&clcid=0x409'
$ar... |
PowerShellCorpus/Github/oldrivercreative_spshells/Solution-Reinstall.ps1 | Solution-Reinstall.ps1 | .\Solution-Uninstall.ps1
.\Solution-Install.ps1
|
PowerShellCorpus/Github/oldrivercreative_spshells/Metadata-Export.ps1 | Metadata-Export.ps1 | Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# export settings (update to match the source environment settings)
$SourceUrl = "http://example.com/"
$SourceTermStoreName = "Managed Metadata Service Application"
$SourceTermGroupName = "Term Group Name"
$SourceTermSetName = "Term Set... |
PowerShellCorpus/Github/oldrivercreative_spshells/Metadata-Import.ps1 | Metadata-Import.ps1 | Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# import settings (update to match the destination environment settings)
$DestinationUrl = "http://example.com/"
$DestinationTermStoreName = "Managed Metadata Service Application"
$DestinationTermGroupName = "Term Group Name"
$Destinati... |
PowerShellCorpus/Github/oldrivercreative_spshells/Search-Move-Index.ps1 | Search-Move-Index.ps1 | # settings
$SearchServiceName = "Search Service Application" # The name of your Search Service Application being altered
$Server = "spweb1-index" # The name of the Index server currently being used
$IndexLocation = "E:\SearchIndex" # The full path to the new Index location
# move search index
function SearchI... |
PowerShellCorpus/Github/oldrivercreative_spshells/Navigation-Export.ps1 | Navigation-Export.ps1 | Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# export settings (update to match the source environment settings)
$SourceUrl = "http://example.com/"
$SourceTermStoreName = "Managed Metadata Service Application"
$SourceTermGroupName = "Site Collection - example.com"
$SourceTermSetNa... |
PowerShellCorpus/Github/oldrivercreative_spshells/Solution-Install.ps1 | Solution-Install.ps1 | #config
$timer = [System.Diagnostics.Stopwatch]::StartNew()
$solution = "Solution.wsp"
$path = ".\" + $solution
$defaultwebapp = "example.com"
# add
Write-Host -ForegroundColor Cyan "Adding solution..."
Add-SPSolution (Resolve-Path $path)
# install
Write-Host -ForegroundColor Cyan "Installing solution..."
... |
PowerShellCorpus/Github/oldrivercreative_spshells/Navigation-Import.ps1 | Navigation-Import.ps1 | Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# import settings (update to match the destination environment settings)
$DestinationUrl = "http://example.com/"
$DestinationTermStoreName = "Managed Metadata Service Application"
$DestinationTermGroupName = "Site Collection - example.co... |
PowerShellCorpus/Github/oldrivercreative_spshells/Solution-Uninstall.ps1 | Solution-Uninstall.ps1 | # config
$timer = [System.Diagnostics.Stopwatch]::StartNew()
$solution = "Solution.wsp"
$defaultwebapp = "example.com"
# retract
Write-Host -ForegroundColor Cyan "Uninstalling solution..."
$webapp = Read-Host " Enter web application name or GUID [$defaultwebapp]"
$webapp = ($defaultwebapp, $webapp)[[bool]$web... |
PowerShellCorpus/Github/oldrivercreative_spshells/Solution-Update.ps1 | Solution-Update.ps1 | #config
$timer = [System.Diagnostics.Stopwatch]::StartNew()
$solution = "Solution.wsp"
$path = ".\" + $solution
# add
Write-Host -ForegroundColor Cyan "Updating solution..."
Update-SPSolution -Identity $solution -LiteralPath (Resolve-Path $path) -GACDeployment -force
# wait for deploy
$deployed = $False
wr... |
PowerShellCorpus/Github/oldrivercreative_spshells/Fix-List-Field-Schemas.ps1 | Fix-List-Field-Schemas.ps1 | Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# update settings
$url = "http://example.com/"
$site = Get-SPSite -Identity $url
write-host “Site [$($site.Url)]" -ForegroundColor Yellow
# field list
$updatefields = @(
"Field1",
"Field2",
"Field3"
)
# all web lists
fo... |
PowerShellCorpus/Github/oldrivercreative_spshells/Test-SMTP-Settings.ps1 | Test-SMTP-Settings.ps1 | # source: http://jeffreypaarhuis.com/2013/02/12/send-test-email-from-sharepoint/
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
# email configuration
$email = "hi@test.com"
$subject = "SharePoint 2013 SMTP Test"
$body = "This is a test email originating from the SharePoint 2013 we... |
PowerShellCorpus/Github/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/xiaojuntang_Dos.Net/Zxxk.Dos.Web/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/I-Telematics_mygitproject/aebappgit/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/I-Telematics_mygitproject/aebappgit/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/I-Telematics_mygitproject/aebappgit/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/I-Telematics_mygitproject/aebappgit/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.