Will add a hosts file entry for the host name specified targeting the specified ip address.
Adds the specified line to the hosts file if it doesn't already exist.
Add-HostsFileEntry [-hostName] <String> [[-ipAddress] <String>] [[-includeLoopbackFix]] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
hn | The "host name" name you want routed to the target ip address. | true | false | ||
ip | The ip address of the machine you want to target. | false | false | 127.0.0.1 | |
Switch to determine if the Loopback Fix should also be applied (Add-LoopbackFix) | false | false | False |
Add-HostsFileEntry "local.example.ca"EXAMPLE 2
Add-HostsFileEntry "local.example.ca" "10.1.1.1"EXAMPLE 3
Add-HostsFileEntry "local.example.ca" -includeLoopbackFix
Will add or remove a VERB from your website
Secure your site by only allowing approved HTTP Verbs ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'CONNECT', 'PATCH')
Add-IISHttpVerb [-verb] <String> [-siteName] <String> [[-action] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the verb. valid verbs are: [GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH] |
true | false | |||
sn, site | The name of the website that contains this application. | true | false | ||
Add or Remove | false | false | add |
Add-IISHttpVerb PUT "apps.example.ca"
Will add a mapping for the file extension to the mime type on the named IIS site.
Will register a mimetype for a file extension.
Add-IISMimeType [-siteName] <String> [-fileExtension] <String> [-mimeType] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
sn | The name of the IIS site. | true | false | ||
extension, ext | The file extension to map to the mime type. | true | false | ||
The mime type name. | true | false |
Add-IISMimeType "foo.example.com" "json" "application/json"
Will apply a registry entry fix for issue KB896861. Uses the more conservative and recommend fix found in method 1.
Adds a registry entry that overrides the default windows behaviour regarding allowing a different "C" name to point back to 127.0.0.1
Add-LoopbackFix [-siteHostName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
sn | The hostname that you want to loop back to the local host. | true | false |
Add-LoopbackFix "local.mysite.com"
Updates a XML file with the value specified at the XPath expression specified..
Will parse an XML config file and add a xml node at a xpath expression.
Add-XmlConfigValue [-configFile] <String> [-xpath] <String> [-newnode] <String> [[-attributes] <Hashtable>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A path to a file that is XML based | true | false | |||
Any valid XPath exression, whether result in 1 or many matches, must be an Element. | true | false | |||
Any valid XML node name that you wish to add. | true | false | |||
Hashtable of attributes for the new node being created | false | false |
Add-ConfigValues "C:\temp\somefile.config" "//SomeNode/AnotherNode" "SomeNewNode" @{"key0"="value0";"key1"="value1"}
Sets permissions to a specified path for a specific trustee (user)
Sets permissions to a specified path for a specific trustee (user)
Approve-Permissions [-path] <String> [-trustee] <String> [-permission] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The path that you are modifying permissions on | true | false | |||
The user who is being granted the specified permission | true | false | |||
The permission level [full, modify, read-execute, read-only, write-only] |
true | false |
Approve-Permissions 'c:\inetpub\wwwroot' 'Network Service' 'read-execute'
Some powershell modules are only available on a specific version of PS. Call this to ensure the user is running under the appropriate version.
Enforces a specific PS Version
Assert-PSVersion [-requiredVersion] <Int32> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The version of powershell required | true | false | 0 |
Assert-PSVersion 4
Asserts that the condition is true, and if it is not, will throw the specified failure message.
Asserts that the condition is true
Assert-That [-conditionToCheck] <Object> [-failureMessage] <Object> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The condition that you're asserting | true | false | |||
The message to throw if the condition is not met. | true | false |
Assert-That ($name -ne $null) "Name cannot be null."EXAMPLE 2
Assert ($foo -eq $bar) '$foo and $bar must be equal.'
Confirms that the application in question actually exists in IIS
Confirms that the application in question actually exists in IIS
Confirm-ApplicationExists [[-siteName] <Object>] [[-appName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the assocaited IIS website | false | false | |||
Name of the IIS application that we're confirming. | false | false |
Confirm-ApplicatonExists 'mySite' 'myApp'
Will confirm whether or not an application pool exists
Will confirm whether or not an application pool exists
Confirm-AppPoolExists [[-appPoolName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | false | false |
Confirm-AppPoolExists "myAppPool"
Checks to see if a website already exists
Confirm-SiteExists [[-siteName] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the website as it appears in IIS | false | false |
Confirm-SiteExists "myWebsite.com"
Expands any Nuget package and places the contents in the specified folder.
Extracts a Nuget Package file and puts the contents in the specified location.
Expand-NugetPackage [-nugetPackageName] <String> [-destinationFolder] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
pkgName | The full path to the Nuget package. | true | false | ||
dest | The full path to the desired destination. | true | false |
Expand-NugetPackage "something.pkg" "C:\temp\zipcontents"
Expands any zip file and places the contents in the specified folder. This command uses the Windows Shell to do the unzip and as such the file needs to end in ".zip" in order to work. This module will temporarily rename the file to '.zip' extension if necessary in order to unzip it, but it will rename it back when finished.
Expands any zip file and places the contents in the specified folder.
Expand-ZipFile [-zipFileName] <String> [-destinationFolder] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
name | The full path to the zip file. | true | false | ||
to, dest | The full path to the desired unzip location. | true | false |
Expand-ZipFile "something.pkg" "C:\temp\zipcontents"
Attempts to locate the path for the specified tool, and adds it to the $env:PATH so that the tool is accessable throughout the build/release cycle
Takes the name of a tool and tries to guess it's location. If it can't find it, it'll require the user to add the variable `$poshBAR.Paths['toolNamePath']`.
If the tool cannot be located and added to the $env:PATH, an exception will be thrown.
Find-ToolPath [-toolName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
name | The name of the tool to add | true | false |
Find-ToolPath 'dotcover.exe'EXAMPLE 2
Find-ToolPath 'sometool.exe'
This is just a simple helper function to write the current task name to screen in a nice friendly way.
Writes the message to the Host formatted to be easy to read
Format-TaskNameToHost [-taskName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The Name of the task you are executing | true | false |
Format-TaskNameToHost "Doing Some Task"
FormatTaskName { param($taskName) Format-TaskNameToHost $taskName }
Retrieves an application from IIS
Retrieves an application from IIS
Get-Application [[-siteName] <String>] [[-appName] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the associated IIS website | false | false | |||
Name of the IIS application being retrieved. | false | false |
Get-Application 'mySite' 'myApp'
Retrieves all applications from IIS
Retrieves all applications from IIS
Get-Applications [<CommonParameters>]
Get-Applications
Will get an application pool by name
Will get an application pool by name
Get-AppPool [[-appPoolName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | false | false |
Get-AppPool "myAppPool"
Will get all application pools
Get-AppPools [<CommonParameters>]
Get-AppPools
Will grab a set of values from the proper environment file and returns them as an object which you can reffer to like any other object. If there is a matching variable in the OctopusParameters, it will use that variable instead of the one located in the XML.
Properly returns all the environmental settings for the particualr context in which this build is being run.
Get-EnvironmentSettings [-environment] <String> [-nodeXPath] <String> [[-environmentsPath] <String>] [[-culture] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
env | The environment which this build is being run, these environments will match the names of the environments xml config files. If a config file is found that matches the computer on which this is executing, it will use that instead. |
true | false | ||
xpath | A valid XPath expression that matches the set of values you are after. | true | false | / | |
false | false | ||||
If provided will look up settings for an environment based on culture information provided. | false | false |
$dbSettings = Get-EnvironmentSettings "ci" "//database"
Extends the default Get-PfxCertificate function to add 'password' support.
Since the default Get-PfxCertificate function only prompts for a password, it's difficult to automate the process. This function adds password support to the default function
Get-PfxCertificate [-filePath] <String[]> [[-password] <String>] [[-x509KeyStorageFlag] <String>] [<CommonParameters>] Get-PfxCertificate -literalPath <String[]> [[-password] <String>] [[-x509KeyStorageFlag] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A relative path to the pfx file | true | false | |||
The literal path to the pfx file | true | false | |||
The password associated with the pfx file | false | false | |||
Defines where and how to import the private key of an X.509 certificate. Valid flags are: [DefaultKeySet, Exportable, MachineKeySet, PersistKeySet, UserKeySet, UserProtected] |
false | false | DefaultKeySet |
Get-PfxCertificate "$here\myCert.pfx" 'P@$$W0rd'EXAMPLE 2
Get-PfxCertificate -literalPath "C:\certs\myCert.pfx" 'P@$$W0rd'EXAMPLE 3
Get-PfxCertificate ".\myCert.pfx" 'P@$$W0rd' 'UserKeySet'EXAMPLE 4
Get-PfxCertificate "$here\myCert.pfx"
Get-PfxCertificate -literalPath "C:\certs\myCert.pfx"
Gets a website's details
Get-Site [-siteName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the website as it appears in IIS | true | false |
Get-Site "myWebsite.com"
Gets all websites from IIS
Get-Sites [<CommonParameters>]
Get-Sites
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | false | false | |||
None | false | false |
Get's all windows features available to the current machine. Also allows fuzzy filtering based on feature name.
Get-WindowsFeatures [[-filter] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Part of the feature name you would like to filter by. (not case sensitive) | false | false |
The output type is the type of the objects that the cmdlet emits.
Get-WindowsFeaturesEXAMPLE 2
Get-WindowsFeatures http
Installs a web application into IIS.
This is a helper method used to simplify the installation of a web application. There are a lot of dependent modules, see the links below.
Install-WebApplication [-environment] <String> [-websiteSettings] <XmlElement> [[-version] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
env | The environment name that the web application is being installed into. [dev, qual, uat, production] | true | false | ||
ws | An XML node defining all of the required XML settings. An example can be found in the repository. | true | false | ||
v | The version number of the application | false | false |
Install-WebApplication 'dev' $environmentSettings.websites.myWebsite '1.0.2.1234'
Ensures all Windows Features listed within the $features arrray are installed
Install-WindowsFeatures [[-features] <String[]>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The collection of Windows Features to install | false | false |
Install-WindowsFeatures @('IIS-WebServer','IIS-WebServerRole','IIS-ISAPIFilter', 'IIS-ISAPIExtensions', 'IIS-NetFxExtensibility','IIS-ASPNET')EXAMPLE 2
Install-WindowsFeatures 'IIS-ASPNET45?'
Will register asp.net into IIS
Invoke-AspNetRegIIS -siteName <String> [-framework <Double>] [-noRestart] [<CommonParameters>] Invoke-AspNetRegIIS [-i] [-framework <Double>] [-noRestart] [<CommonParameters>] Invoke-AspNetRegIIS [-ir] [-framework <Double>] [-noRestart] [<CommonParameters>] Invoke-AspNetRegIIS [-iru] [-framework <Double>] [-noRestart] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
s | Install ASP.NET to a specific site only (recommended). | true | false | ||
Install ASP.NET and updates existing applications to use the specified version of the application pool. | true | false | False | ||
Installs and registers ASP.NET. This option is the same as the -i option except that it does not change the CLR version associated with any existing application pools. | true | false | False | ||
If ASP.NET is not currently registered with IIS, performs the tasks of -i. If a previous version of ASP.NET is already registered with IIS, performs the tasks of -ir. | true | false | False | ||
The framework version to register. Defaults to 4.0 |
false | false | 4 | ||
Tells aspnet_regiis.exe to NOT restart IIS. | false | false | False |
aspnet_regiis -s example.com -norestartEXAMPLE 2
Invoke-AspNetRegIIS -iEXAMPLE 3
aspnet_regiis -iru -framework 3.5
Execute block with with token replaced file
Invoke-BlockWithTokenReplacedFile [[-fileToTokenReplace] <String>] [[-tokenValues] <Hashtable>] [[-blockToAcceptTokenReplacedFile] <ScriptBlock>] [-continuationMessage <String>] [-errorMessage <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
File to perform token replacement on | false | false | |||
Hashtable of key value pairs to replaced in file | false | false | |||
Block to execute with token replaced file. The block must accept the token replaced file path as the first parameter. | false | false | |||
Optional parameter to indicate a continuation on error with the requested message printed. | false | false | |||
Optional parameter to indicate halt on error with the requested message printed. (Default without this parameter is to re-throw the original error) | false | false |
Invoke-BlockWithTokenReplacedFile "somePath\someFile.txt" @{ 'token1Key' = 'token1Value'; 'token2Key' = 'token2Value' } { param($tokenReplacedFile) DoSomethingWithFile $tokenReplacedFile }
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | true | false | |||
None | true | false | |||
None | true | false | |||
None | true | false |
Run's the Chutzpah javascript test tool over a specified directory
Chutzpah is an open source JavaScript test runner which enables you to run unit tests using QUnit, Jasmine, Mocha, CoffeeScript and TypeScript.
Invoke-Chutzpah [-testDirectory] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The directory to start the tests from. | true | false |
Invoke-Chutzpah 'C:\Dev\MyApp\src'
Cleans the project/solution
Invoke-CleanMSBuild [-projectFile] <String> [[-verbosity] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The path to your project (.csproj) or solution (.sln) file | true | false | |||
Sets the MSBuild verbosity - [q] = quiet - [m] - minimal - [n] = normal - [d] = detailed - [diag] = diagnostic |
false | false | q |
Invoke-CleanMSBuild $buildOutputDir
Invoke-CleanMSBuild $buildOutputDir -verbosity n
Invokes the deployment steps on the target machine
Call this after all deployment steps are defined within your deploy script.
This method will iterate over all of the deployment steps, execute the script block, and capture the timing.
Invoke-Deployment [<CommonParameters>]
Invoke-Deployment
This will invoke all of the deployment scripts in order in the same way that Octopus Deploy does it. If a deployment fails, it will try to run the deployFailed.ps1 and then throws the exception.
Deploys an nupkg the same way Octopus Deploy would do it.
Invoke-DeployOctopusNugetPackage [-pathToPackage] <String> [-environment] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The fully qualified path to your nupkg file that is being deployed | true | false | |||
The name of the environment that you're deploying to. | true | false |
Test-DeployOctopusNugetPackage "C:\myApp\myApp.nupkg" "production"
Generates Specflow Features from Excel spreadsheets
Invoke-Ecliptic [[-testDir] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The directory containing test case spreadsheets | false | false |
Invoke-Ecliptic 'C:/dev/myProject/src/myProject.Tests/'EXAMPLE 2
ecliptic 'C:/dev/myProject/src/myProject.Tests/'
Invoke a powershell script block as Administrator
Invokes the provided script block in a new elevated (Administrator) powershell process,
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output
will be LOST - only the object pipeline and errors are handled. In general, prefer
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information.
Also see Community Extensions "Invoke-Elevated"/"su"
Invoke-ElevatedCommand [-Scriptblock] <ScriptBlock> [[-InputObject] <Object>] [-EnableProfile] [-DisplayWindow] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A script block to be executed with elevated priviledges. | true | false | |||
An optional object (of any type) to be passed in to the scriptblock (available as $input) | false | true (ByValue) | |||
A switch that enables powershell profile loading for the elevated command/block | false | false | False | ||
A switch that enables the display of the spawned process (for potential interaction) | false | false | False |
Invoke-ElevatedCommand {"Hello World"}EXAMPLE 2
"test" | Invoke-ElevatedCommand {$input | Out-File -filepath c:\test.txt}EXAMPLE 3
Invoke-ElevatedCommand {$one = 1; $zero = 0; $throwanerror = $one / $zero}
Run Entity Framework migrations against a target database.
Run Entity Framework migrations against a target database.
Invoke-EntityFrameworkMigrations [[-targetAssembly] <String>] [[-startupDirectory] <String>] [[-connectionString] <String>] [[-databaseName] <String>] [-dropDB] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The assembly containing the Entity Framework Migrations | false | false | |||
If your assembly has dependencies or reads files relative to the working directory then you will need to set startupDirectory. | false | false | |||
Connection string to the database server | false | false | |||
Name of the database being migrated | false | false | |||
Should the database be dropped prior to running the migrations. This is good during integration testing. | false | false | False |
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode to see if an error occcured. If an error is detected then an exception is thrown. This function allows you to run command-line programs without having to explicitly check the $lastexitcode variable.
This executes a scriptblock and checks the PS variable $lastexitcode for errors.
Invoke-ExternalCommand [-command] <ScriptBlock> [[-errorMessage] <String>] [-retry <Int32>] [-msDelay <Int32>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The command in the form of a script block that you want to execute. | true | false | |||
The message you'd like to display on failure of the command. Defaults to thrown exception if left blank. |
false | false | |||
The number of times to retry the command before failing. | false | false | 0 | ||
The number of milliseconds to delay between retries. (only applies when $retry -gt 0) | false | false | 250 |
Exec { git st } "Error getting GIT status. Please verify GIT command-line client is installed"EXAMPLE 2
Invoke-ExternalCommand {get st} "Error getting GIT status. Please verify GIT command-line client is installed" -retry 10 -msDelay 1000
Converts a string from Base64
Invoke-FromBase64 [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A base64 encoded string | true | false |
Invoke-FromBase64 $base64EncodedString
Html Decodes a string
Invoke-HtmlDecode [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string to be html decoded | true | false |
Invoke-HtmlDecode $htmlEncodedString
Html Encodes a string
Invoke-HtmlEncode [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string to be html encoded | true | false |
Invoke-HtmlEncode $myString
Uses Grunt and Karma to test javascript
Uses Grunt and Karma to test javascript
Invoke-KarmaTests [[-rootPath] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The path to the grunt file | false | false |
Invoke-KarmaTests "C:\Dev\myApp\src\myApp.Website"
Compiles a solution or project against MSBuild
Invoke-MSBuild [-outDir] <String> [-projectFile] <String> [-target <String>] [-logPath <String>] [-namespace <String>] [-visualStudioVersion <Double>] [-toolsVersion <String>] [-maxCpuCount <Int32>] [-verbosity <String>] [-warnOnArchitectureMismatch <Boolean>] [-customParameters <String[]>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The output directory for your compilation | true | false | |||
The path to your project (.csproj) or solution (.sln) file | true | false | |||
t | Build the specified targets in the project. Specify each target separately, or use a semicolon or comma to separate multiple targets | false | false | build | |
The directory where your logs should end up | false | false | |||
Used when generating build warnings. | false | false | |||
The version of Visual Studio that the solution or project was built against | false | false | 12 | ||
tv | The version of the .NET framework that the solution or project targets | false | false | 4 | |
m | Maximum number of CPU's to use during the compilation | false | false | 1 | |
v, loglevel | Sets the MSBuild verbosity - [q]uiet - [m]inimal - [n]ormal - [d]etailed - [diag]nostic |
false | false | minimal | |
Show warnings for architecture missmatch (x86 and x64) [MSB3270] | false | false | False | ||
Additional msbuild parameters in array format. | false | false |
Invoke-MSBuild $buildOutputDir $solutionFile
Invoke-MSBuild $buildOutputDir $solutionFile -customParameters @('/property:SomeProperty=value')
Invoke-MSBuild $buildOutputDir $solutionFile -target 'clean' -logPath 'c:\logs' -namespace 'My.App.Namespace' -visualStudioVersion 11.0 -toolsVersion 4.0 -maxCpuCount 8 -verbosity 'normal' -warnOnArchitectureMismatch $true
Runs nUnit against a test dll
Invoke-Nunit [[-targetAssembly] <String>] [[-outputDir] <String>] [[-runCommand] <String>] [[-includeCoverage] <Boolean>] [[-coverageRulesPath] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The target test assembly | false | false | |||
The directory to store the output | false | false | |||
The namespace to start the tests from | false | false | |||
Switch to tell if we want coverage on the tests | false | false | False | ||
Path to coverage rules | false | false |
Invoke-Nunit "$buildDir\myTestAssembly.dll" "$outputDir" "myAssembly.Unit" -includeCoverage "$coverageRulesPath"
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | false | false | |||
None | false | false | |||
None | false | false | |||
None | false | false |
Execute Oracle SQL Command using OracleClient
Invoke-OracleCommand [[-sqlToRun] <String>] [[-connectionString] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SQL to be Executed | false | false | |||
Oracle Connection String | false | false |
Invoke-OracleCommand "SELECT 2*35 FROM DUAL" "Data Source=;User Id=SYSTEM;Password=xxxx"
Execute Oracle SQL Command using OracleClient
Invoke-OracleFile [[-sqlFile] <String>] [[-connectionString] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SQL script containing sql commands | false | false | |||
Oracle Connection String | false | false |
Invoke-OracleFile "C:\path\to\script.sql" "Data Source=;User Id=SYSTEM;Password=xxxx"
Converts a powershell script to UTF8 and then signs it against a certificate
Converts a powershell script to UTF8 and then signs it against a certificate
Invoke-PowershellScriptSigning [-scripts] <String[]> [[-certStorePath] <String>] [<CommonParameters>] Invoke-PowershellScriptSigning [-scripts] <String[]> [[-pfxFilePath] <PathInfo>] [[-password] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
An array of powershell scripts to be signed | true | false | |||
Path to the certificate directory | false | false | LocalMachine\My | ||
File path to a .pfx certificate. | false | false | |||
false | false |
Invoke-PowershellScriptSigning @("C:\temp\someposh.ps1", "C:\otherposh.ps1")EXAMPLE 2
Invoke-PowershellScriptSigning @("C:\temp\someposh.ps1", "C:\otherposh.ps1") "CurrentUser\My"EXAMPLE 3
Invoke-PowershellScriptSigning @("C:\temp\someposh.ps1", "C:\otherposh.ps1") (Resolve-Path 'C:\path\to\my.pfx')
Runs SpecFlow tests against a test dll using the specified testing framework
Invoke-SpecFlow [-testProjectFile] <String> [-testAssemblyFile] <String> [-outputDir] <String> [-runCommand] <String> [-testingFramework] <Object> [[-coverageRulesPath] <String>] [[-includeCoverage]] [[-showSpecflowReport]] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
the .csproj file containing your tests. | true | false | |||
The target test assembly (dll) | true | false | |||
The directory to store the output | true | false | |||
The namespace to start the tests from | true | false | |||
Which testing framework is being leveraged (nunit & xunit supported) | true | false | |||
Path to coverage rules | false | false | |||
Switch to tell if we want coverage on the tests | false | false | False | ||
Should the specflow report be loaded in the browser after testing is complete. | false | false | False |
Invoke-Nunit "$buildDir\myTestAssembly.dll" "$outputDir" "myAssembly.Unit" -includeCoverage "$coverageRulesPath"
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | true | false | |||
None | true | false | |||
None | false | false |
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | true | false | |||
None | true | false | |||
None | false | false |
Converts a string to Base64
Invoke-ToBase64 [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string to be base64 encoded | true | false |
Invoke-ToBase64 $myString
URL Decodes a string
Invoke-UrlDecode [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string to be url decoded | true | false |
Invoke-UrlDecode $urlEncodedString
URL Encodes a string
Invoke-UrlEncode [-str] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string to be url encoded | true | false |
Invoke-UrlEncode $myString
Check to see if a website is up and running
Check to see if a website is up and running
Invoke-WebHealthCheck [-uri] <String> [[-verbs] <String[]>] [[-postData] <String>] [[-contentType] <String>] [[-timeout] <Int32>] [[-customHeaders] <Object>] [[-credentials] <NetworkCredential>] [<CommonParameters>] Invoke-WebHealthCheck [-request] <Object> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
An object containing all of the fields required to make a Web Health Check. This is used when storing all of the data in an XML document. A hashtable also works. | true | false | |||
The endpoint we are making the request to. | true | false | |||
methods | An array of http verbs [GET, PUT, POST, DELETE, HEAD, OPTIONS, TRACE ]. | false | false | GET | |
The data you would like to send with the request (will not work with GET). | false | false | {} | ||
The Content Type to be sent with the request. | false | false | application/json | ||
How long to wait before timing out the request. | false | false | 30000 | ||
Any additional headers that should be sent with the request. | false | false | |||
A [System.Net.NetworkCredential] object containing the credentials to be sent with the request. | false | false |
Invoke-WebHealthCheck 'http://google.com' 'GET'EXAMPLE 2
Invoke-WebHealthCheck @{uri = 'https://google.com'; verbs = 'GET'}
Will transform one XML doc with another using the standard xdt transform
Invoke-XmlDocumentTransform [-inputPathAndFile] <String> [-transformPathAndFile] <String> [[-outputPathAndFile] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
true | false | ||||
true | false | ||||
false | false |
Runs XUnit against a test dll
Invoke-XUnit [[-targetAssembly] <String>] [[-outputDir] <String>] [[-runCommand] <String>] [[-includeCoverage] <Boolean>] [[-coverageRulesPath] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The target test assembly | false | false | |||
The directory to store the output | false | false | |||
The namespace to start the tests from | false | false | |||
Switch to tell if we want coverage on the tests | false | false | False | ||
Path to coverage rules | false | false |
Invoke-XUnit "$buildDir\myTestAssembly.dll" "$outputDir" "myAssembly.Unit" -includeCoverage "$coverageRulesPath"
Runs XUnit against a test dll
Invoke-XUnitWithCoverage [[-targetAssembly] <String>] [[-outputDir] <String>] [[-runCommand] <String>] [[-coverageRulesPath] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The target test assembly | false | false | |||
The directory to store the output | false | false | |||
The namespace to start the tests from | false | false | |||
Path to coverage rules | false | false |
Invoke-XUnitWithCoverage "$buildDir\myTestAssembly.dll" "$outputDir" "myAssembly.Unit" "$coverageRulesPath"
Locks an object to prevent simultaneous access from another thread.
PowerShell implementation of C#'s "lock" statement. Code executed in the script block does not have to worry about simultaneous modification of the object by code in another thread.
Lock-Object [-InputObject] <Object> [-ScriptBlock] <ScriptBlock> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The object which is to be locked. This does not necessarily need to be the actual object you want to access; it's common for an object to expose a property which is used for this purpose, such as the ICollection.SyncRoot property. | true | false | |||
The script block that is to be executed while you have a lock on the object. Note: This script block is "dot-sourced" to run in the same scope as the caller. This allows you to assign variables inside the script block and have them be available to your script or function after the end of the lock block, if desired. |
true | false |
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
$hashTable = @{}; lock ($hashTable.SyncRoot) { $hashTable.Add("Key", "Value") }
$hashTable = @{}; Lock-Object -InputObject $hashTable.SyncRoot -ScriptBlock { $hashTable.Add("Key", "Value")}
Will setup a web application under the specified Website and AppPool.
Will setup a web application under the specified Website and AppPool.
New-Application [-siteName] <String> [-appName] <String> [-appPath] <String> [-appPoolName] <String> [[-updateIfFound]] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
sn | The name of the website that contains this application. | true | false | ||
an | The name of the application. | true | false | ||
The physical path where this application is located on disk. | true | false | |||
The application pool that this application runs under. | true | false | |||
With this switch passed in, the Applications PhysicalPath will be updated to point to the new AppPath provided, otherwise, if it already exists it will just be left alone. | false | false | False |
New-Application "MyApp" "apps.mysite.com" "C:\inetpub\apps.mysite.com\MyApp" "MyApp"
Will setup an Application Pool for an IIS Application.
Creates an AppPool in IIS and sets up the specified identity to run under.
New-AppPool [-appPoolName] <String> [[-appPoolIdentityType] <String>] [[-maxProcesses] <Int32>] [[-username] <String>] [[-password] <String>] [[-idleTimeout] <TimeSpan>] [[-managedPipelineMode] <String>] [[-managedRuntimeVersion] <String>] [-alwaysRunning] [-updateIfFound] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | true | false | |||
The type of identity you want the AppPool to run as, default is 'LocalSystem'. | false | false | NetworkService | ||
The number of Worker Processes this AppPool should spawn, default is 1. | false | false | 1 | ||
un | The Username that this app pool should run as. | false | false | ||
pwd | The password for the Username that this app pool should run as. | false | false | ||
Amount of time a worker process will remain idle before it shuts down. | false | false | 00:20:00 | ||
Is the app pool to be running as 'Classic', or 'Integrated' (Defaults to Integrated) | false | false | Integrated | ||
Runtime version for the app pool. (Defaults to v4.0) | false | false | v4.0 | ||
Should the app pool be configured as 'Always Running' | false | false | False | ||
If the application pool already exists, update it with the new information. | false | false | False |
New-AppPool "myAppPool" "NetworkService"EXAMPLE 2
New-AppPool "myAppPool" "NetworkService" -managedPipelineMode 'Classic'
Generates a new Certificate (.crt)
Uses openssl.exe to Generate a new Certificate.
The newly created file will be [name].crt
New-Certificate [-certData] <Hashtable> [<CommonParameters>] New-Certificate [-name] <String> [-outPath] <String> [-key] <String> [-csr] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The hashtable containing all of the required data (useful when piping calls). | true | true (ByValue) | |||
The name associated with your new certificate | true | false | |||
out | The location where your new certificate will be dropped | true | false | ||
Name of the certificate key (name.key) Must reside in the $outPath |
true | false | |||
Name of the certificate signing request (name.csr) Must reside in the $outPath |
true | false |
New-Certificate 'cert-name' 'C:\path\to\output' 'certName.key' 'certName.csr'
Generates a new Certificate Signing Request (.csr)
Uses openssl.exe to Generate a new Certificate Signing Request.
The newly created file will be [name].csr
New-CertificateSigningRequest [-certData] <Hashtable> [<CommonParameters>] New-CertificateSigningRequest [-name] <String> [-outPath] <String> [-subject] <String> [-key] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The hashtable containing all of the required data (useful when piping calls). | true | true (ByValue) | |||
The name associated with your new certificate | true | false | |||
out | The location where your new certificate will be dropped | true | false | ||
cn | true | false | |||
Name of the certificate key (name.key) Must reside in the $outPath |
true | false |
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
New-CertificateSigningRequest 'cert-name' 'C:\path\to\output' '/CN=bla' 'cert-name.key'
Generates a nuget package from a specified nuspec
New-NugetPackage [-nuspecFile] <String> [-version] <String> [-outputDirectory] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The nuspec file used to generate the nupkg | true | false | |||
The version of the application being packaged | true | false | |||
The location of the generated nupkg file | true | false |
CREATES new database with requested user as owner
New-OracleDatabase [-schemaName] <String> [-databaseStorageFile] <String> [-schemaOwnerUserId] <String> [-schemaOwnerPassword] <String> [-connectionString] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
true | false | ||||
true | false | ||||
true | false | ||||
true | false | ||||
true | false |
New-OracleDatabase 'MyDatabase' 'C:\databases\MyDatabase.dbf' 'MyUser' 'MyUserPassword' 'Data Source=localhost/XE;User Id=system;Password=SAus3r'
Generates a new Certificate containing both the public and private keys (.pfx)
Uses openssl.exe to Generate a new Public/Private Key pair.
The newly created file will be [name].pfx
New-PfxCertificate [-certData] <Hashtable> [-password] <String> [<CommonParameters>] New-PfxCertificate [-outPath] <String> [-key] <String> [-crt] <String> [-name] <String> [-password] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The hashtable containing all of the required data (useful when piping calls). | true | true (ByValue) | |||
out | The location where your new certificate will be dropped | true | false | ||
Name of the certificate key (name.key) Must reside in the $outPath |
true | false | |||
Name of the certificate (name.crt) Must reside in the $outPath |
true | false | |||
The name associated with your new certificate | true | false | |||
pwd | The password associated with your new certificate | true | false |
New-PfxCertificate 'c:\path\to\output' 'certName.key' 'certName.crt" 'certName' 'certP@ssword'
Generates a new Private Key (.key)
Uses openssl.exe to Generate a new Private Key .
The newly created file will be [name].key
New-PrivateKey [-name] <String> [-password] <String> [-subject] <String> [-outPath] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name associated with your new certificate | true | false | |||
pwd | The password associated with your new certificate | true | false | ||
cn | The subject information associated with your new certificate | true | false | ||
out | The location where your new certificates will be dropped | true | false |
New-PrivateKey 'cert-name' 'certP@ssword" '/CN=bla' 'C:\path\to\output'
Generates a new Private Key (.key) and a Certificate Signing Request (.csr)
Uses openssl.exe to Generate a new Private Key and a Certificate Signing Request.
The two files that will be created will be [name].key and [name].csr
New-PrivateKeyAndCertificateSigningRequest [-name] <String> [-password] <String> [-subject] <String> [-outPath] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name associated with your new certificate | true | false | |||
pwd | The password associated with your new certificate | true | false | ||
cn | The subject information associated with your new certificate | true | false | ||
out | The location where your new certificates will be dropped | true | false |
New-PrivateKeyAndCertificateSigningRequest 'cert-name' 'certP@ssword" '/CN=bla' 'C:\path\to\output'
Will setup a website under the specified site name and AppPool.
Will create a Website with the specified settings if one doesn't exist.
New-Site [-siteName] <String> [-sitePath] <String> [-bindings] <Object[]> [-appPoolName] <String> [[-updateIfFound]] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the Website that we are creating. | true | false | |||
The physical path where this Website is located on disk. | true | false | |||
An Object Array of bindings. Must include "protocol", "port", and "hostName" | true | false | |||
The name of the app pool to use | true | false | |||
Should we update an existing website if it already exists? | false | false | False |
New-Site "myWebsite.com" "c:\inetpub\wwwroot" @(@{"protocol" = "http"; "port" = 80; "hostName"="mysite.com"}) "myAppPool" -updateIfFound
Removes an application from IIS
Removes an application from IIS
Remove-Application [[-siteName] <Object>] [[-appName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the associated IIS website | false | false | |||
Name of the IIS application being removed. | false | false |
Remove-Application 'mySite' 'myApp'
Will remove an application pool by name
Will remove an application pool by name
Remove-AppPool [[-appPoolName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | false | false |
Remove-AppPool "myAppPool"
DROPS Database! Drops a development Oracle database by dropping tablespace
Remove-OracleDatabase [-schemaName] <String> [-schemaOwnerUserId] <String> [-connectionString] <String> [[-failOnError] <Boolean>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
true | false | ||||
true | false | ||||
true | false | ||||
false | false | True |
Remove-OracleDatabase 'MyDatabase' 'MyUser' 'Data Source=localhost/XE;User Id=system;Password=SAus3r' $false
Removes an existing website
Remove-Site [-siteName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the website as it appears in IIS | true | false |
Remove-Site "myWebsite.com"
Creates a deployment step that verifies that the required windows features are installed
When certain Windows Features are required for an application to run, simply add those required windows features to an array and pass them into this function
RequiredWindowsFeatures [[-requiredWindowsFeatures] <String[]>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The collection of windows features required. | false | false |
RequiredWindowsFeatures @('IIS-WebServer','IIS-WebServerRole')
DROPS and RECREATES Database! Resets a development Oracle database by dropping tablespace and recreating with requested user as owner
Reset-OracleDatabase [-schemaName] <String> [-databaseStorageFile] <String> [-schemaOwnerUserId] <String> [-schemaOwnerPassword] <String> [-connectionString] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
true | false | ||||
true | false | ||||
true | false | ||||
true | false | ||||
true | false |
Reset-OracleDatabase 'MyDatabase' 'C:\databases\MyDatabase.dbf' 'MyUser' 'MyUserPassword' 'Data Source=localhost/XE;User Id=system;Password=SAus3r'
Will set the specified Authentication value for the specified applicaiton or website.
Will set the specified Authentication value for the specified applicaiton or website
Set-IISAuthentication [-authTypes] <AuthType[]> [-value] <PSObject> [-location] <String> [[-disableOthers]] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the Authentication setting that we are changing | true | false | |||
What we want to change the setting to. | true | false | |||
The IIS location of the Application or Website that we want to change the setting on. | true | false | |||
Disables all other authentication types except for the ones contained in the array. | false | false | False |
Set-IISAuthentication "windowsAuthentication" true "apps.mysite.com/MyApp"
Will set a custom header to specified value on the site indicated.
Will set the specified Authentication value for the specified applicaiton or website
Set-IISCustomHeader [-siteName] <String> [-customHeaderName] <String> [-customHeaderValue] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the site to add custom header to. | true | false | |||
The name of the custom header to add. | true | false | |||
The value of the custom header to add. | true | false |
Set-IISCustomHeader "xyz.mysite.com" "access-control-allow-origin" "*"
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | false | false | |||
None | false | false | |||
None | false | false | |||
None | true | false | |||
None | false | false | |||
None | true | false |
Starts an application from IIS
Starts an application from IIS
Start-Application [[-siteName] <Object>] [[-appName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the associated IIS website | false | false | |||
Name of the IIS application being started. | false | false |
Start-Application 'mySite' 'myApp'
Will start an application pool by name
Will start an application pool by name
Start-AppPool [[-appPoolName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | false | false |
Start-AppPool "myAppPool"
Starts a website
Start-Site [-siteName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the website as it appears in IIS | true | false |
Start-Site "myWebsite.com"
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | true | false | |||
None | true | false |
Stops an application from IIS
Stops an application from IIS
Stop-Application [[-siteName] <Object>] [[-appName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the associated IIS website | false | false | |||
Name of the IIS application being stopped. | false | false |
Stop-Application 'mySite' 'myApp'
Will stop an application pool by name
Will stop an application pool by name
Stop-AppPool [[-appPoolName] <Object>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | false | false |
Stop-AppPool "myAppPool"
Stops a website
Stop-Site [-siteName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the website as it appears in IIS | true | false |
Stop-Site "myWebsite.com"
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
None | true | false |
Tests if this powershell invocation is being run as administrator, will break and display an error if it is not.
Tests if this powershell invocation is being run as administrator.
Test-RunAsAdmin [<CommonParameters>]
Test-RunAsAdministrator
Will update an IIS Application, only works if the application already exists.
Update IIS Application
Update-Application [-siteName] <String> [-appName] <String> [-appPath] <String> [-appPoolName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name of the associated IIS Website | true | false | |||
Name of the IIS Application to be updated | true | false | |||
Fully qualified path to the application being updated. | true | false | |||
Name of the application pool that the app is running under. | true | false |
Update-Application 'mySite' 'myApp' 'C:\inetput\wwwroot' 'appPoolName'
Will update an Application Pool for an IIS Application.
Updates an AppPool in IIS and sets up the specified identity to run under.
Update-AppPool [-appPoolName] <String> [[-appPoolIdentityType] <String>] [[-maxProcesses] <Int32>] [[-username] <String>] [[-password] <String>] [[-idleTimeout] <TimeSpan>] [[-managedPipelineMode] <String>] [[-managedRuntimeVersion] <String>] [-alwaysRunning] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the application pool. | true | false | |||
The type of identity you want the AppPool to run as, default is 'LocalSystem'. | false | false | NetworkService | ||
The number of Worker Processes this AppPool should spawn, default is 1. | false | false | 1 | ||
The Username that this app pool should run as. | false | false | |||
The password for the Username that this app pool should run as. | false | false | |||
Amount of time a worker process will remain idle before it shuts down. | false | false | 00:20:00 | ||
Is the app pool to be running as 'Classic', or 'Integrated' (Defaults to Integrated) | false | false | Integrated | ||
Runtime version for the app pool. (Defaults to v4.0) | false | false | v4.0 | ||
Should the app pool be configured as 'Always Running' | false | false | False |
Update-AppPool "myAppPool" "NetworkService"EXAMPLE 2
Update-AppPool "myAppPool" "NetworkService" -managedPipelineMode 'Classic'
Update all the AssemblyInfo.cs files in a solution so they are the same.
This will search for AssemblyInfo.cs files in the current directory and its sub directories,
and then updates the AssemblyVersion and AssemblyFileVersion.
Update-AssemblyVersions [-Version] <String> [-BuildNumber] <String> [-AssemblyInformationalVersion] <String> [[-projectRoot] <String>] [[-copyrightFormatString] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A string containing the version of this dll. This would be in the format of {Major}.{Minor}.{Revision} | true | false | |||
The build number of the assembly. | true | false | |||
A string value indicating some info about the assembly | true | false | |||
Where to begin recursion when searching for the AssemblyInfo.cs files to be updated. | false | false | ..\ | ||
copyright | The string you want to use in the copyright field | false | false |
Update-AssemblyVersions '3.1.2', '233', '3.1.2 Beta 1' -copyright 'Copyright {0} Acme Corp.'
Updates a JSON element with a new value
Updates a JSON element with a new value
Update-JsonConfigValues [-configFile] <String> [-node] <String> [-value] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path to JSON config file | true | false | |||
Path to property being updated (dotted notation) | true | false | |||
New value for the updated node. | true | false |
Update-JsonConfigValues "c:\path\to.json" "user[0].address.streetAddress" "21 Jump St."EXAMPLE 2
Update-JsonConfigValues "c:\path\to.json" "website.siteHost" "http://www.example.com"
Will update a website under the specified site name and AppPool.
Will update a Website with the specified settings if one doesn't exist.
Update-Site [-siteName] <String> [-sitePath] <String> [-bindings] <Object[]> [-appPoolName] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
The name of the Website that we are updating. | true | false | |||
The physical path where this Website is located on disk. | true | false | |||
An Object Array of bindings. Must include "protocol", "port", and "hostName" | true | false | |||
The name of the app pool to use | true | false |
Update-Site "myWebsite.com" "c:\inetpub\wwwroot" @(@{"protocol" = "http"; "port" = 80; "hostName"="mysite.com"}) "myAppPool"
Updates a XML file with the value specified at the XPath expression specified..
Will parse an XML config file and replace the values at a xpath expression with the value passed in.
Update-XmlConfigValues [-configFile] <String> [-xpath] <String> [-value] <String> [[-attributeName] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A path to a file that is XML based | true | false | |||
Any valid XPath exression, wether result in 1 or many matches, wether a Element or and Attribute. | true | false | |||
Any valid XML value that you wish to set. | true | false | |||
false | false |
Update-ConfigValues "C:\temp\somefile.config" "//SomeNode/AnotherNode" "Some New Value"
Wrap a disposable object in this method, and after the scriptblock executes, it will dispose of the object.
This will allow you to wrap a disposable object in a using statement (akin to C#), and it will dispose of that object when the scriptblock is finished executing.
Use-Object [-InputObject] <Object> [-ScriptBlock] <ScriptBlock> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
A disposable object. This object will be disposed of once the script block finishes execution. | true | false | |||
The script block to be executed. | true | false |
Use-Object ($foo = new-object System.Some.Disposable.Object) { $foo.DoSomething }EXAMPLE 2
psUsing($foo = new-object System.Some.Disposable.Object) { $foo.DoSomething }
Writes a copy of file with tokens replaced to requested output file
Write-TokenReplacedFile [[-fileToTokenReplace] <String>] [[-outFile] <String>] [[-tokenValues] <Hashtable>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
File to perform token replacement on | false | false | |||
Output file for token replaced result | false | false | |||
Hashtable of key value pairs to replaced in file | false | false |
Write-TokenReplacedFile "somePath\someFile.txt" "somePath\tokenReplacedFile.txt" @{ 'token1Key' = 'token1Value'; 'token2Key' = 'token2Value' }