This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result | Add-Member -MemberType ScriptMethod ExpandString -Value { | |
[cmdletbinding()] | |
param( | |
[Parameter( | |
Mandatory=$true)] | |
[string] | |
$unexpandedValue | |
) | |
process{ | |
if($this.ProjectInstance){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" | |
DefaultTargets="Build" | |
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<OutDir Condition=" '$(OutDir)'=='' ">$(MSBuildThisFileDirectory)bin\</OutDir> | |
<Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration> | |
<SourceHome Condition=" '$(SourceHome)'=='' ">$(MSBuildThisFileDirectory)src\</SourceHome> | |
<ToolsHome Condition=" '$(ToolsHome)'=='' ">$(MSBuildThisFileDirectory)tools\</ToolsHome> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original by JOEL 'JAYKUL' BENNETT http://huddledmasses.org/a-dsl-for-xml-in-powershell-new-xdocument/ | |
# modified by Sayed Ibrahim Hashimi for PowerShell 4 | |
# Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492 | |
# to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations | |
# and prefixes are removed from all XML nodes (by an XSL transform) before searching. | |
# IMPORTANT: returned results *will not* have namespaces in them, even if the input XML did. | |
# Also, only raw XmlNodes are returned from this function, so the output isn't completely compatible | |
# with the built in Select-Xml. It's equivalent to using Select-Xml ... | Select-Object -Expand Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Display-MessageInForegroundColors { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
$message | |
) | |
process{ | |
[enum]::getvalues([type]'ConsoleColor') | ForEach-Object{ | |
$curForeground = $_ | |
'{0}: {1}' -f $message,$curForeground | Write-Host -ForegroundColor $curForeground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALLUSERSPROFILE C:\DWASFiles\Sites\WebjobsEnvvars\ProgramData | |
APP_POOL_CONFIG C:\DWASFiles\Sites\WebjobsEnvvars\Config\applicationhost.config | |
APP_POOL_ID WebjobsEnvvars | |
APPDATA C:\DWASFiles\Sites\WebjobsEnvvars\AppData | |
APPSETTING_REMOTEDEBUGGINGVERSION 11.0.611103.400 | |
APPSETTING_ScmType None | |
APPSETTING_WEBSITE_NODE_DEFAULT_VERSION 0.10.29 | |
APPSETTING_WEBSITE_SITE_NAME WebjobsEnvvars | |
aspnet:DisableFcnDaclRead true | |
aspnet:PortableCompilationOutput true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OptimizeImages{ | |
[cmdletbinding()] | |
param( | |
$folder, | |
$force = $false, | |
$customTemp = "$env:LocalAppData\CustomPublish\", | |
$imgOptUrl = 'https://raw.githubusercontent.com/ligershark/AzureJobs/master/ImageCompressor.Job/optimize-images.ps1' | |
) | |
process{ | |
if(!(Test-Path $customTemp)){New-Item $customTemp -ItemType Directory} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GetNuget"> | |
<!-- | |
This is an MSBuild snippet that can be used to download nuget to the path | |
in the property NuGetExePath property. | |
Usage: | |
1. Copy and paste this into your build script | |
2. Call the GetNuGet target before you use nuget.exe from $(NuGetExePath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env powershell | |
<# | |
.SYNOPSIS | |
You can use this script to easly transform any XML file using XDT. | |
To use this script you can just save it locally and execute it. The script | |
will download its dependencies automatically. | |
Created by sayediHashimi | |
Modified by obscurerichard | |
Thanks Stack Overflow: https://stackoverflow.com/questions/8989737/web-config-transforms-outside-of-microsoft-msbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- | |
This shows how you can calculate the elapsed time in MSBuild | |
--> | |
<Target Name="BeforeBuild"> | |
<PropertyGroup> | |
<startTime>$([System.DateTime]::Now)</startTime> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding()] | |
param( | |
[Parameter( | |
Mandatory=$true, | |
Position=0, | |
ValueFromPipeline=$true)] | |
$folder, | |
[bool]$backup = $true, |