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
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
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
[cmdletbinding()] | |
param( | |
[Parameter( | |
Mandatory=$true, | |
Position=0, | |
ValueFromPipeline=$true)] | |
$folder, | |
[bool]$backup = $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
[cmdletbinding(SupportsShouldProcess=$true)] | |
param($PublishProperties, $OutputPath) | |
function Ensure-PublishModuleLoaded{ | |
[cmdletbinding()] | |
param($versionToInstall = '0.0.3-beta', | |
$installScriptUrl = 'https://raw.githubusercontent.com/sayedihashimi/publish-module/master/GetPublishModule.ps1', | |
$toolsDir = ("$env:LOCALAPPDATA\LigerShark\tools\"), | |
$installScriptPath = (Join-Path $toolsDir 'GetPublishModule.ps1')) | |
process{ |
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
<# | |
.SYNOPSIS | |
This can be used to get a list of the contributors for a git repo (folder). | |
Inspired by http://ayende.com/blog/4532/extracting-a-list-of-committers-from-git. | |
.EXAMPLE | |
Get-ChildItem .\ -Directory -Exclude .git | Get-Contributors -verbose| select -unique -verbose|sort | |
#> | |
function Get-Contributors{ |
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
:: based on code from http://pastebin.com/raw.php?i=xn37jvtF by @AdamUCF | |
:: save this as a .cmd file on your desktop and double click to open the "Metro" IE | |
:: note: if you save from the web right click "Unblock" to allow execution | |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "((new-object net.webclient).DownloadString('http://pastebin.com/raw.php?i=xn37jvtF')) | iex" |
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
<!-- | |
MSBuild snippet which you can paste into your .csproj/.vbproj for a VSIX or Visual Studio Package project | |
to have the libgit2sharp NativeBinaries .dlls included in the final .vsix. | |
Modified version of http://chrisparnin.github.io/articles/2013/09/deploying-native-binaries-with-visual-studio-extensions/ | |
--> | |
<PropertyGroup> | |
<EnableIncludeLibGit2SharpInVsix Condition=" '$(EnableIncludeLibGit2SharpInVsix)'=='' ">true</EnableIncludeLibGit2SharpInVsix> | |
</PropertyGroup> | |
<ItemGroup Condition=" '$(EnableIncludeLibGit2SharpInVsix)'=='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
$files = Get-ChildItem C:\Data\personal\mycode\side-waffle\TemplatePack\ItemTemplates\Web *.vstemplate -Recurse -Exclude C:\Data\personal\mycode\side-waffle\TemplatePack\ItemTemplates\Web\ASP.NET | |
foreach($filePath in $files){ | |
[xml]$templateXml = Get-Content $filePath | |
$updatedFile = $false | |
'Processing [{0}]' -f $filePath | Write-Host | |
if($templateXml.VSTemplate.TemplateData.TemplateID){ |
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
# PowerShell one liner which can be used to delete some temp files which are added to Visual Studio projects. | |
# ***Use at your own risk*** | |
get-childitem "$env:userprofile\Documents" 'Visual Studio*' -Directory | % { Get-ChildItem $_.Fullname -Include bin,obj,packages,node_modules,artifacts -Directory -Recurse }|Select-Object -Property Fullname | % { if(Test-Path $_.FullName){Remove-Item $_.FullName -Recurse -Force -ErrorAction Continue }} |
OlderNewer