This file contains hidden or 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] $axml= Get-Content E:\Code\Library\DataLayer.csproj | |
$ns = new-object Xml.XmlNamespaceManager $axml.NameTable | |
$ns.AddNamespace("d", "http://schemas.microsoft.com/developer/msbuild/2003") | |
$nodes = $axml.SelectNodes( "/d:Project/d:ItemGroup/d:Reference", $ns) | |
foreach ($node in $nodes) { | |
$object = New-Object –TypeName PSObject | |
$object | Add-Member -MemberType NoteProperty –Name File –Value (split-path $path -leaf) | |
$object | Add-Member –MemberType NoteProperty –Name Name –Value $node.Include | |
$object | Add-Member –MemberType NoteProperty –Name Path –Value $node.HintPath |
This file contains hidden or 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
$lines = select-string -Path E:\Code\Application\Websit1.sln -Pattern "^Project.*" | |
$lines | % { | |
$pattern = "Project.*=\s`"([^`"]*)`", `"([^`"]*)" | |
if ([Regex]::IsMatch($_.Line, $pattern) ) { | |
$matches = [Regex]::Matches($_.Line, $pattern) | |
$name = $matches[0].Groups[1].Value | |
$path = $matches[0].Groups[2].Value |
This file contains hidden or 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
gci -Path E:\Code\ -Filter *.sln -Recurse | select Name, FullName |
This file contains hidden or 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 Setup-Pester { | |
$ModulePath = "C:\Users\johnm\Documents\WindowsPowerShell\Modules" | |
$PesterModulePath = "$ModulePath\Pester" | |
if ((Test-Path $PesterModulePath) -eq $true) { | |
write-host Deleting Existing -ForegroundColor Gray | |
ri $PesterModulePath -Recurse -Force | |
} |
This file contains hidden or 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 Build-Sln() { | |
Param( | |
[parameter(ValueFromPipeline)] | |
[string] $slnPath | |
) | |
Process { | |
$msbuildExe = "C:\Windows\Microsoft.Net\Framework\v4.0.30319\msbuild.exe" |
This file contains hidden or 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
private static string ConvertMarkdown(string unsafeMarkdown) | |
{ | |
var encodedMarkdown = HttpUtility.HtmlEncode(unsafeMarkdown); | |
var unsafeContent = CommonMark.CommonMarkConverter.Convert(encodedMarkdown); | |
var safeContent = new HtmlSanitizer().Sanitize(unsafeContent); | |
return safeContent; | |
} |
This file contains hidden or 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
(Get-Project -all).Object.References | | |
Where-Object { $_.Name -eq "Castle.Core" } | | |
Select-Object Identity, Path |
This file contains hidden or 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
gci D:\git\TimesheetsPoc -Recurse -Filter *.csproj | foreach { | |
write-host Processing $_.Name -ForegroundColor Green | |
Get-Content $_.FullName | select-string -Pattern "v10.0" | |
} |
This file contains hidden or 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 tail (){ | |
Param( | |
[string] $file, | |
[int] $last = 10 | |
) | |
Get-Content $file | Select-Object -Last $last | |
} |
This file contains hidden or 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
public class IdentityConfig | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
app.CreatePerOwinContext(() => new TimesheetsContext()); | |
app.CreatePerOwinContext<UserManager>(UserManager.Create); | |
app.CreatePerOwinContext<RoleManager<Role>>((options, context) => | |
new RoleManager<Role>( | |
new RoleStore<Role>(context.Get<TimesheetsContext>()))); |