Skip to content

Instantly share code, notes, and snippets.

View sayedihashimi's full-sized avatar

Sayed Ibrahim Hashimi sayedihashimi

View GitHub Profile
@sayedihashimi
sayedihashimi / sample.config
Created March 17, 2015 17:42
XDT Transform samples
<configuration>
<connectionStrings>
<clear/>
<add name="Default" connectionString="Data Source=localhost;Initial Catalog=Sample01;Integrated Security=True;" />
</connectionStrings>
<appSettings>
<add key="contactEmail" value="contact@demo.example.com"/>
<add key="siteUrl" value="http://demo.example.com"/>
</appSettings>
@sayedihashimi
sayedihashimi / limit-nuget.md
Last active July 6, 2018 14:34
how to limit nuget packages and versions to specific ones

Question: How can I ensure that all projects only use a specific set of nuget packages and versions? I'm using VS2017.

The way that I would handle this is to add a (directory.build.targets)[https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build#directorybuildprops-and-directorybuildtargets] to help in this scenario.

The idea is that you will add an msbuild .targets file in the source root named directory.build.targets. In that file you can inject a target to be run before the build starts. For example,

@sayedihashimi
sayedihashimi / dotnet-new-ux.ps1
Last active March 1, 2018 12:24
dotnet new user interaction
[cmdletbinding()]
param()
# to run this script:
# (new-object Net.WebClient).DownloadString("https://gist.githubusercontent.com/sayedihashimi/899ed1a47953ea6a45f60220687cfdd6/raw/b3ad6ab230b5c4a9cf5b39d3142fc7b36df8c54f/run-dotnetnew-ux.ps1") | iex
function StartDefault{
[cmdletbinding()]
param()
process{
@sayedihashimi
sayedihashimi / dotnet-new-templates.txt
Last active July 24, 2017 18:54
Templates availabe on nuget.org for dotnet new
--- template report ---
Name DownloadCount Percent overall
---- ------------- ---------------
Microsoft.AspNetCore.SpaTemplates 44876 65.4 %
Microsoft.DotNet.Web.Spa.ProjectTemplates 6253 9.1 %
libyear 1860 2.7 %
Boilerplate.Templates 1600 2.3 %
IdentityServer4.Templates 1136 1.7 %
Amazon.Lambda.Templates 1122 1.6 %
@sayedihashimi
sayedihashimi / find-duplicates.ps1
Last active November 19, 2016 06:12
This will find duplicate files from one folder to another.
[cmdletbinding()]
param(
[string]$sourceFolder = $pwd
)
function Find-DuplicateFiles{
[cmdletbinding()]
param(
[string]$sourceFolder = $pwd
)
@sayedihashimi
sayedihashimi / machine-setup.ps1
Last active November 15, 2016 22:42
temp files
[cmdletbinding()]
param()
$global:machinesetupconfig = @{
MachineSetupConfigFolder = (Join-Path $env:temp 'SayedHaMachineSetup')
MachineSetupAppsFolder = (Join-Path $env:temp 'SayedHaMachineSetup\apps')
BaseChocoPackages = @(
'boxstarter',
'boxstarter.winconfig'
'git.install',

MSBuild Feedback

This feedback is on the experience of using MSBuild, not just on msbuild.exe

Not in any order, I may sort them later.

Have people want to author scripts using MSBuild

Today creating and maintaining MSBuild scripts is challenging. Some of the challenges for the user include.

@sayedihashimi
sayedihashimi / download-tablebases
Created September 18, 2016 18:43
Download Nalimov table bases (3/4/5)
[cmdletbinding()]
param()
function DownloadTablebases{
[cmdletbinding()]
param(
$baseUrl = 'http://www.chesskit.com/download/nalimov',
$allFilename = 'all.txt',
$downloadRoot = ($pwd)
)
@sayedihashimi
sayedihashimi / call-msdeploy.ps1
Last active September 14, 2016 16:18
Shows how to call msdeploy.exe from powershell
function Execute-CommandString{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[string[]]$command,
[switch]
$ignoreExitCode
)
@sayedihashimi
sayedihashimi / template-deps.md
Last active May 7, 2016 22:41
Template dependencies