full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtAddTypes.ps1
OxPtAddTypes.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Convert-DocxToHtml.ps1
Convert-DocxToHtml.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Test-OxPtCmdlets.ps1
Test-OxPtCmdlets.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-WmlDocument.ps1
New-WmlDocument.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/OxPtUtils.ps1
OxPtUtils.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-Docx-Template.ps1
New-Docx-Template.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Merge-Docx.ps1
Merge-Docx.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Expand-DocxFormatting.ps1
Expand-DocxFormatting.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-Pptx-Template.ps1
New-Pptx-Template.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/ConvertFrom-Base64.ps1
ConvertFrom-Base64.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-Docx.ps1
New-Docx.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Get-OpenXmlValidationErrors.ps1
Get-OpenXmlValidationErrors.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/DocxLib.ps1
DocxLib.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2015. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-PmlDocument.ps1
New-PmlDocument.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Add-DocxText.ps1
Add-DocxText.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.m...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/ConvertTo-FlatOpc.ps1
ConvertTo-FlatOpc.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/PptxLib.ps1
PptxLib.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2015. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Clear-DocxTrackedRevision.ps1
Clear-DocxTrackedRevision.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/ConvertFrom-FlatOpc.ps1
ConvertFrom-FlatOpc.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Get-DocxMetrics.ps1
Get-DocxMetrics.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Test-OpenXmlValid.ps1
Test-OpenXmlValid.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/New-Pptx.ps1
New-Pptx.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/ConvertTo-Base64.ps1
ConvertTo-Base64.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2014. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtCmdlets/Merge-Pptx.ps1
Merge-Pptx.ps1
<#*************************************************************************** Copyright (c) Microsoft Corporation 2015. This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here: http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.msp...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/NewDocxDocuments/GenerateNewDocxCmdlet.ps1
GenerateNewDocxCmdlet.ps1
[environment]::CurrentDirectory = $(Get-Location) if (-not $(Test-Path .\GenerateNewDocxCmdlet.ps1)) { Throw "You must run this script from within the NewDocxDocuments directory" } $dx = "..\OxPtCmdlets\DocxLib.ps1" if (Test-Path $dx) { del $dx } $lineBreak = [System.Environment]::NewLine [System.Text...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-New-Docx.ps1
Ex-New-Docx.ps1
New-Docx Out-1 -Bookmark New-Docx Out-2.docx -Comment New-Docx Out-3.docx -CoverPage New-Docx Out-All.docx -All -LoadAndSaveUsingWord [OpenXmlPowerTools.WmlDocument]$wml = New-Docx -Bookmark $wml.SaveAs("Out-4.docx")
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-Expand-DocxFormatting.ps1
Ex-Expand-DocxFormatting.ps1
[environment]::CurrentDirectory = $(Get-Location) New-Docx WithStyles.docx -Headings -LoadAndSaveUsingWord Expand-DocxFormatting WithStyles.docx
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-Clear-DocxTrackedRevision.ps1
Ex-Clear-DocxTrackedRevision.ps1
[environment]::CurrentDirectory = $(Get-Location) Copy-Item .\TrackedRevision.docx .\Out-NoTrackedRevisions.docx Clear-DocxTrackedRevision Out-NoTrackedRevisions.docx Copy-Item .\TrackedRevision.docx .\Out-NoTrackedRevisions2.docx Clear-DocxTrackedRevision Out-NoTrackedRevisions*.docx
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-Merge-Docx.ps1
Ex-Merge-Docx.ps1
[environment]::CurrentDirectory = $(Get-Location) function MergeDocxExample { param ( [int]$exampleNum ) switch ($exampleNum) { 1 { $doc1 = New-Object OpenXmlPowerTools.Source("Input1.docx") $doc2 = New-Object OpenXmlPowerTools.Source("Input2.docx", $True) ...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-Get-OpenXmlValidationErrors.ps1
Ex-Get-OpenXmlValidationErrors.ps1
[environment]::CurrentDirectory = $(Get-Location) function GetOpenXmlValidationErrorsExample { param ( [int]$exampleNum ) switch ($exampleNum) { 1 { Get-OpenXmlValidationErrors Valid.docx -OfficeVersion 2010 -Verbose Get-OpenXmlValidationErrors Invalid.docx ...
PowerShellCorpus/Github/alek-sys_openxmlpowertools/OxPtExamples/Ex-Test-OpenXmlValid.ps1
Ex-Test-OpenXmlValid.ps1
[environment]::CurrentDirectory = $(Get-Location) function TestOpenXmlValidExample { param ( [int]$exampleNum ) switch ($exampleNum) { 1 { Test-OpenXmlValid Valid.docx -OfficeVersion 2010 -Verbose Test-OpenXmlValid Invalid.docx -OfficeVersion 2007 -Verbose ...
PowerShellCorpus/Github/ManuelNinahuanca_Plantilla-bootstrap/lib/bootstrap/nuget/MyGet.ps1
MyGet.ps1
$nuget = $env:NuGet #parse the version number out of package.json $bsversion = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version #create packages & $nuget pack "nuget\bootstrap.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $b...
PowerShellCorpus/Github/DomsFalle_BFrontier/BraveFrontier/packages/EntityFramework.4.3.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if ([System.AppDomain]::CurrentDomain.GetAssemblies() | ?{ $_.GetName().Name -eq 'EntityFramework' }) { Write-Warning 'There is already a version of EntityFramework.dll loaded. You may need to restart Visual Studio for the commands to work properly.' } if...
PowerShellCorpus/Github/DomsFalle_BFrontier/BraveFrontier/packages/EntityFramework.4.3.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) $invoker = @" public class ConnectionFactoryConfiguratorInvoker { public static void Invoke(string assemblyPath, object project) { var appDomain = System.AppDomain.CreateDomain( "EntityFramework.PowerShell", null, ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/vmDemo.ps1
vmDemo.ps1
Configuration vmDemo { Param( [string]$NodeName = 'localhost' ) Import-DscResource -ModuleName cChoco,xStorage,xPSDesiredStateConfiguration Node $NodeName { LocalConfigurationManager { DebugMode = 'ForceModuleImport' } cChocoInstaller installChoco { InstallDir = "c:\choco" ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/ExampleConfig.ps1
ExampleConfig.ps1
Configuration myChocoConfig { Import-DscResource -Module cChoco Node "localhost" { LocalConfigurationManager { DebugMode = 'ForceModuleImport' } cChocoInstaller installChoco { InstallDir = "c:\choco" } cChocoPackageInstaller installChro...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Examples/cChocoInstaller_cChocoPackageInstallExample.ps1
cChocoInstaller_cChocoPackageInstallExample.ps1
Configuration InstallChoco { Import-DscResource -Module cChoco Node "localhost" { cChocoPackageInstaller installSkypeWithChocoParams { Name = 'skype' Ensure = 'Present' AutoUpgrade = $True }...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Examples/cChocoInstaller_cChocoInstallerExample.ps1
cChocoInstaller_cChocoInstallerExample.ps1
Configuration InstallChoco { Import-DscResource -Module cChoco Node "localhost" { cChocoInstaller InstallChoco { InstallDir = "c:\choco" } cChocoPackageInstaller installSkypeWithChocoParams { Name = 'skype' ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/AppVeyor/AppVeyorBuild.ps1
AppVeyorBuild.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor build script' -ForegroundColor Yellow Write-Host "ModuleName : $env:ModuleName" Write-Host "Build version : $env:APPVEYOR_BUILD_VERSION" Write-Host "Author : $env:A...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/AppVeyor/AppVeyorInstall.ps1
AppVeyorInstall.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor install script' -ForegroundColor Yellow #---------------------------------# # Install NuGet # #---------------------------------# Write-Host 'Installi...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/AppVeyor/AppVeyorDeploy.ps1
AppVeyorDeploy.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor deploy script' -ForegroundColor Yellow #---------------------------------# # Update module manifest # #---------------------------------# Write-Host 'Creating ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/AppVeyor/AppVeyorTest.ps1
AppVeyorTest.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor test script' -ForegroundColor Yellow Write-Host "Current working directory: $pwd" #---------------------------------# # Run Pester Tests # #--------------...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Tests/cChocoInstaller_Tests.ps1
cChocoInstaller_Tests.ps1
#---------------------------------# # Pester tests for cChocoInstall # #---------------------------------# $ResourceName = ((Split-Path $MyInvocation.MyCommand.Path -Leaf) -split '_')[0] $ResourceFile = (Get-DscResource -Name $ResourceName).Path Describe "Testing $ResourceName loaded from $ResourceFile" { ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Tests/cChoco_ScriptAnalyzerTests.ps1
cChoco_ScriptAnalyzerTests.ps1
#---------------------------------# # PSScriptAnalyzer tests # #---------------------------------# $Rules = Get-ScriptAnalyzerRule #Only run on cChocoInstaller.psm1 for now as this is the only resource that has had code adjustments for PSScriptAnalyzer rules. $Modules = Get-ChildItem “$PSScriptRoot...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Tests/cChoco_xDscResourceTests.ps1
cChoco_xDscResourceTests.ps1
#---------------------------------# # xDscResourceTests Pester # #---------------------------------# $DSC = Get-DscResource | Where-Object {$_.Module.Name -eq 'cChoco'} Describe 'Testing all DSC resources using xDscResource designer.' { foreach ($Resource in $DSC) { if (-not ($Resource.Implem...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/cChoco/Tests/cChocoPackageInstall_Tests.ps1
cChocoPackageInstall_Tests.ps1
#----------------------------------------# # Pester tests for cChocoPackageInstall # #----------------------------------------# $ResourceName = ((Split-Path -Path $MyInvocation.MyCommand.Path -Leaf) -split '_')[0] $ResourceFile = (Get-DscResource -Name $ResourceName).Path $TestsPath = (split-path -path $M...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xProcessSet_Start.ps1
Sample_xProcessSet_Start.ps1
<# .SYNOPSIS Starts the processes with the executables at the file paths C:\Windows\cmd.exe and C:\TestPath\TestProcess.exe with no arguments. #> Configuration Sample_xProcessSet_Start { [CmdletBinding()] param () Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xServiceSet_StartServices.ps1
Sample_xServiceSet_StartServices.ps1
<# .SYNOPSIS Ensures that the DHCP Client and Windows Firewall services are running. #> Configuration xServiceSetStartExample { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' xServiceSet ServiceSet1 { Name = @( 'Dhcp', 'MpsSvc' ) Ensure = 'Present' ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xDscWebServiceRegistrationWithSecurityBestPractices.ps1
Sample_xDscWebServiceRegistrationWithSecurityBestPractices.ps1
# DSC configuration for Pull Server using registration with enhanced security settings # The Sample_xDscWebServiceRegistrationWithEnhancedSecurity configuration sets up a DSC pull server that is capable for client nodes # to register with it and retrieve configuration documents with configuration names instead of c...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Test_Sample_xArchive_CompressMultipleDirs.ps1
Test_Sample_xArchive_CompressMultipleDirs.ps1
$zipFilePath = "$pwd\Target.zip" del "$pwd\SourceDir-1" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\SourceDir-2" -Force -Recurse -ErrorAction SilentlyContinue New-Item $pwd\SourceDir-1 -Type Directory | Out-Null New-Item $pwd\SourceDir-1\Sample-1.txt -Type File | Out-Null New-Item $pwd\SourceDir-...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_InstallMSIProductId_xPackage.ps1
Sample_InstallMSIProductId_xPackage.ps1
<# Simple installer that installs an msi package and matches based on the product id. #> param ( [String]$OutputPath = ".", [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $PackageName, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $S...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xEnvironment_Remove.ps1
Sample_xEnvironment_Remove.ps1
<# .SYNOPSIS Removes the environment variable 'TestEnvironmentVariable' from both the machine and the process. #> Configuration Sample_xEnvironment_Remove { param () Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost { xEnvironment Re...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Test_Sample_xArchive_ExpandArchive.ps1
Test_Sample_xArchive_ExpandArchive.ps1
$zipFilePath = "$pwd\SampleArchive.zip" $expandedZipDir = "$pwd\TargetExpanded" del "$pwd\SourceDir" -Force -Recurse -ErrorAction SilentlyContinue del "$zipFilePath" -Force -Recurse -ErrorAction SilentlyContinue New-Item $pwd\SourceDir -Type Directory | Out-Null New-Item $pwd\SourceDir\Sample-1.txt -Type Fil...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xDscWebServiceRemoval.ps1
Sample_xDscWebServiceRemoval.ps1
# DSC configuration for removal of Pull Server and Compliance Server configuration Sample_xDscWebService { param ( [string[]]$NodeName = 'localhost' ) Import-DSCResource -ModuleName xPSDesiredStateConfiguration Node $NodeName { WindowsFeature DSCServiceFeature ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsOptionalFeatureSet_Disable.ps1
Sample_xWindowsOptionalFeatureSet_Disable.ps1
<# .SYNOPSIS Disables the Windows optional features TelnetClient and LegacyComponents and removes all files associated with these features. #> Configuration xWindowsOptionalFeatureSet_Disable { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' xWindowsOptionalFeatureSet...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xUser_Generic.ps1
Sample_xUser_Generic.ps1
param ( [Parameter(Mandatory)] [System.String] $ConfigurationName ) <# Create a custom configuration by passing in whatever values you need. $Password is the only param that is required since it must be a PSCredential object. If you want to create a user with minimal att...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xGroup_RemoveMembers.ps1
Sample_xGroup_RemoveMembers.ps1
<# .SYNOPSIS If the group named GroupName1 does not exist, creates a group named GroupName1. If the group named GroupName1 already exists removes the users that have the usernames Username1 or Username2 from the group. #> Configuration Sample_xGroup_RemoveMembers { [Cmd...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_InstallExeCreds_xPackage.ps1
Sample_InstallExeCreds_xPackage.ps1
<# Simple package that installs an .exe using credentials to access the installer and specifying RunAs Credentials. #> param ( [String]$OutputPath = ".", [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $PackageName, [parameter(Mandatory = $true)] [ValidateNo...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsOptionalFeature.ps1
Sample_xWindowsOptionalFeature.ps1
<# .SYNOPSIS Enables the Windows optional feature with the specified name and outputs a log to the specified path. .PARAMETER FeatureName The name of the Windows optional feature to enable. .PARAMETER LogPath The path to the file to log the enable operation to. .NOTE...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRemoteFileUsingProxy.ps1
Sample_xRemoteFileUsingProxy.ps1
configuration Sample_xRemoteFile_DownloadFileUsingProxy { param ( [string[]] $nodeName = 'localhost', [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $destinationPath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsProcess_StartUnderUser.ps1
Sample_xWindowsProcess_StartUnderUser.ps1
<# .SYNOPSIS Starts the gpresult process under the given credential which generates a log about the group policy. The path to the log is provided in 'Arguments'. .PARAMETER Credential Credential to start the process under. #> Configuration Sample_xWindowsProcess_StartUnderUser ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xService_DeleteService.ps1
Sample_xService_DeleteService.ps1
<# .SYNOPSIS Stops and then removes the service with the name Service1. #> Configuration Sample_xService_DeleteService { [CmdletBinding()] param () Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost { xService ServiceResource1 ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xArchive_CompressArchive.ps1
Sample_xArchive_CompressArchive.ps1
Configuration Sample_xArchive_CompressArchive { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination, [parameter (mandatory=$false...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xGroup_SetMembers.ps1
Sample_xGroup_SetMembers.ps1
<# .SYNOPSIS If the group named GroupName1 does not exist, creates a group named GroupName1 and adds the users with the usernames Username1 and Username2 to the group. If the group named GroupName1 already exists, removes any users that do not have the usernames Userna...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsProcess_Start.ps1
Sample_xWindowsProcess_Start.ps1
<# .SYNOPSIS Starts the gpresult process which generates a log about the group policy. The path to the log is provided in 'Arguments'. #> Configuration Sample_xWindowsProcess_Start { param () Import-DSCResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xService_UpdateStartupTypeIgnoreState.ps1
Sample_xService_UpdateStartupTypeIgnoreState.ps1
<# .SYNOPSIS If the service with the name Service1 does not exist, this configuration would throw an error since the Path is not included here. If the service with the name Service1 already exists, sets the startup type of the service with the name Service1 to Manual and ignor...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRemoteFile.ps1
Sample_xRemoteFile.ps1
configuration Sample_xRemoteFile_DownloadFile { param ( [string[]] $nodeName = 'localhost', [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $destinationPath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsFeature.ps1
Sample_xWindowsFeature.ps1
<# Create a custom configuration by passing in whatever values you need. $Name is the only parameter that is required which indicates which Windows Feature you want to install (or uninstall if you set Ensure to Absent). LogPath and Credential are not included here, but if you would like to specify ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xScript.ps1
Sample_xScript.ps1
<# .SYNOPSIS Creates a file at the given file path with the specified content through the xScript resource. .PARAMETER FilePath The path at which to create the file. .PARAMETER FileContent The content to set for the new file. #> Configuration xScriptExample { [Cmdlet...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xProcessSet_Stop.ps1
Sample_xProcessSet_Stop.ps1
<# .SYNOPSIS Stops the processes with the executables at the file paths C:\Windows\cmd.exe and C:\TestPath\TestProcess.exe with no arguments and logs any output to the path C:\OutputPath\Output.log. #> Configuration Sample_xProcessSet_Stop { [CmdletBinding()] param () ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsPackageCab.ps1
Sample_xWindowsPackageCab.ps1
<# .SYNOPSIS Installs a package from the cab file with the specified name from the specified source path and outputs a log to the specified log path. .PARAMETER Name The name of the package to install. .PARAMETER SourcePath The path to the cab file to install the p...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xGroupSet_AddMembers.ps1
Sample_xGroupSet_AddMembers.ps1
<# .SYNOPSIS If the groups named GroupName1 and Administrators do not exist, creates the groups named GroupName1 and Administrators and adds the users with the usernames Username1 and Username2 to both groups. If the groups named GroupName1 and Administrators already e...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xUser_CreateUser.ps1
Sample_xUser_CreateUser.ps1
Configuration xUserExample { param ( [System.Management.Automation.PSCredential] $PasswordCredential ) Import-DscResource -ModuleName xPSDesiredStateConfiguration xUser xUserExample { Ensure = 'Present' # To ensure the user account does not exist, set Ensure to ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsFeatureSet_Uninstall.ps1
Sample_xWindowsFeatureSet_Uninstall.ps1
<# .SYNOPSIS Uninstalls the TelnetClient and RSAT-File-Services Windows features, including all their subfeatures. Logs the operation to the file at 'C:\LogPath\Log.log'. #> Configuration xWindowsFeatureSetExample_Install { [CmdletBinding()] param () Import-DscResource -Module...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRegistryResource_RemoveKey.ps1
Sample_xRegistryResource_RemoveKey.ps1
<# .SYNOPSIS Removes the registry key called MyNewKey under the parent key 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'. #> Configuration Sample_xRegistryResource_RemoveKey { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost {...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xServiceSet_BuiltInAccount.ps1
Sample_xServiceSet_BuiltInAccount.ps1
<# .SYNOPSIS Sets the Secure Socket Tunneling Protocol and DHCP Client services to run under the built-in account LocalService. #> Configuration xServiceSetBuiltInAccountExample { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' xServiceSet ServiceSet1 { ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xService_CreateService.ps1
Sample_xService_CreateService.ps1
<# .SYNOPSIS If the service with the name Service1 does not exist, creates the service with the name Service1 and the executable/binary path 'C:\FilePath\MyServiceExecutable.exe'. The new service will be started by default. If the service with the name Service1 already exists,...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xEnvironment_CreatePathVariable.ps1
Sample_xEnvironment_CreatePathVariable.ps1
<# .SYNOPSIS Creates the environment variable 'TestPathEnvironmentVariable' and sets the value to 'TestValue' if it doesn't already exist or appends the value 'TestValue' to the existing path if it does already exist on the machine and within the process. #> Configuration Sample_xEnvir...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRegistryResource_RemoveValue.ps1
Sample_xRegistryResource_RemoveValue.ps1
<# .SYNOPSIS Removes the registry key value MyValue from the key 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'. #> Configuration Sample_xRegistryResource_RemoveValue { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost { ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsFeatureSet_Install.ps1
Sample_xWindowsFeatureSet_Install.ps1
<# .SYNOPSIS Installs the TelnetClient and RSAT-File-Services Windows features, including all their subfeatures. Logs the operation to the file at 'C:\LogPath\Log.log'. #> Configuration xWindowsFeatureSetExample_Install { [CmdletBinding()] param () Import-DscResource -ModuleNa...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xEnvironment_CreateNonPathVariable.ps1
Sample_xEnvironment_CreateNonPathVariable.ps1
<# .SYNOPSIS Creates the environment variable 'TestEnvironmentVariable' and sets the value to 'TestValue' both on the machine and within the process. #> Configuration Sample_xEnvironment_CreateNonPathVariable { param () Import-DscResource -ModuleName 'xPSDesiredStateConfiguration'...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_InstallMSI_xPackage.ps1
Sample_InstallMSI_xPackage.ps1
<# Simple installer for an msi package that matches via the Name. #> param ( [String]$OutputPath = ".", [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $PackageName, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $SourcePath ) Conf...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsProcess_StopUnderUser.ps1
Sample_xWindowsProcess_StopUnderUser.ps1
<# .SYNOPSIS Stops the gpresult process running under the given credential if it is running. Since the Arguments parameter isn't needed to stop the process, an empty string is passed in. .PARAMETER Credential Credential that the process is running under. #> Configuratio...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xDscWebServiceRegistration.ps1
Sample_xDscWebServiceRegistration.ps1
# DSC configuration for Pull Server using registration # The Sample_xDscWebServiceRegistration configuration sets up a DSC pull server that is capable for client nodes # to register with it and retrieve configuration documents with configuration names instead of configuration id # Prerequisite: Install a certifi...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsProcess_Stop.ps1
Sample_xWindowsProcess_Stop.ps1
<# .SYNOPSIS Stops the gpresult process if it is running. Since the Arguments parameter isn't needed to stop the process, an empty string is passed in. #> Configuration Sample_xWindowsProcess_Stop { param () Import-DSCResource -ModuleName 'xPSDesiredStateConfiguratio...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xWindowsOptionalFeatureSet_Enable.ps1
Sample_xWindowsOptionalFeatureSet_Enable.ps1
<# .SYNOPSIS Enables the Windows optional features MicrosoftWindowsPowerShellV2 and Internet-Explorer-Optional-amd64 and outputs a log of the operations to a file at the path 'C:\LogPath\Log.txt'. #> Configuration xWindowsOptionalFeatureSet_Enable { Import-DscResource -ModuleName...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xArchive_CompressMultipleDirs.ps1
Sample_xArchive_CompressMultipleDirs.ps1
Configuration Sample_xArchive_CompressMultipleDirs { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination, [parameter (mandatory=$...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRegistryResource_AddKey.ps1
Sample_xRegistryResource_AddKey.ps1
<# .SYNOPSIS Create a new registry key called MyNewKey as a subkey under the key 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'. #> Configuration Sample_xRegistryResource_AddKey { Import-DscResource -ModuleName 'xPSDesiredStateConfiguration' Node localhost ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xArchive_ExpandArchive.ps1
Sample_xArchive_ExpandArchive.ps1
Configuration Sample_xArchive_ExpandArchive { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination ) Import-DscResource -ModuleNam...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_InstallExeCredsRegistry_xPackage.ps1
Sample_InstallExeCredsRegistry_xPackage.ps1
<# Simple package that installs an .exe using credentials to access the installer and specifying RunAs Credentials. This sample also uses custom registry data to discover the package. #> param ( [String]$OutputPath = ".", [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xPSSessionConfiguration.ps1
Sample_xPSSessionConfiguration.ps1
configuration Sample_xPSEndpoint_NewWithDefaults { param ( [Parameter(Mandatory)] [String]$Name ) Import-DscResource -module xPSDesiredStateConfiguration xPSEndpoint PSSessionConfiguration { Name = $Name Ensure = 'Present' } } configuration...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Test_Sample_xArchive_CompressArchive.ps1
Test_Sample_xArchive_CompressArchive.ps1
$zipFilePath = "$pwd\Target.zip" del "$pwd\Sample-1.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\Sample-2.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\Sample-3.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\SourceDir-1" -Force -Recurse -ErrorAction SilentlyContinue ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xRegistryResource_AddOrModifyValue.ps1
Sample_xRegistryResource_AddOrModifyValue.ps1
<# .SYNOPSIS If the registry key value MyValue under the key 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' does not exist, creates it with the Binary value 0. If the registry key value MyValue under the key 'HKLM:\SYSTEM\CurrentControlSet\Contro...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/Sample_xFileUpload.ps1
Sample_xFileUpload.ps1
Configuration FileUploadConfiguration { param ( [parameter(Mandatory = $true)] [String] $destinationPath, [parameter(Mandatory = $true)] [String] $sourcePath, [PSCredential] $credential, [String] $certificateThumbprint ) Import-DscResource -modulename xPSDesiredStateConfiguration no...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Examples/PullServerDeploymentVerificationTest/PullServerSetupTests.ps1
PullServerSetupTests.ps1
<# * * Once you setup your pull server with registration, run the following set of tests on the pull server machine * to verify if the pullserver is setup properly and ready to go. #> <# * Prerequisites: * You need Pester module to run this test. * With PowerShell 5, use Install-Module Pester to instal...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/ResourceDesignerScripts/New-PSSessionConfigurationResource.ps1
New-PSSessionConfigurationResource.ps1
Import-Module -Name 'xDSCResourceDesigner' $resProperties = @{ Name = New-xDscResourceProperty -Description 'Name of the PS Remoting Endpoint' ` -Name Name -Type String -Attribute Key RunAsCred = New-xDscResourceProperty -Description 'Credential fo...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/ResourceDesignerScripts/GenerateXRemoteFileSchema.ps1
GenerateXRemoteFileSchema.ps1
$DestinationPath = New-xDscResourceProperty -Name DestinationPath -Type String -Attribute Key -Description 'Path under which downloaded or copied file should be accessible after operation.' $Uri = New-xDscResourceProperty -Name Uri -Type String -Attribute Required -Description 'Uri of a file which should be copied or ...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Tests/Unit/MSFT_xWindowsPackageCab.Tests.ps1
MSFT_xWindowsPackageCab.Tests.ps1
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'CommonTestHelper.psm1') $script:testEnvironment = Enter-DscResourceTestEnvironment ` -DscResourceModuleName 'xPSDesiredStateConfiguration' ` -DscResourceName 'MSFT_xWindowsPackageCab' ` -TestType 'Unit' try {...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Tests/Unit/MSFT_xRegistryResource.Tests.ps1
MSFT_xRegistryResource.Tests.ps1
$errorActionPreference = 'Stop' Set-StrictMode -Version 'Latest' # Import CommonTestHelper for Enter-DscResourceTestEnvironment, Exit-DscResourceTestEnvironment $script:testsFolderFilePath = Split-Path $PSScriptRoot -Parent $script:commonTestHelperFilePath = Join-Path -Path $testsFolderFilePath -ChildPath 'Common...
PowerShellCorpus/Github/jamesbannan_storage-iops-latency-throughput-demo/dsc/xPSDesiredStateConfiguration/Tests/Unit/MSFT_xServiceResource.Tests.ps1
MSFT_xServiceResource.Tests.ps1
# Need to be able to create a password from plain text to create test credentials [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () $errorActionPreference = 'Stop' Set-StrictMode -Version 'Latest' # Import CommonTestHelper for Enter-DscRes...