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
| param([Parameter(Mandatory=$true)][string]$filename, [string]$displayname) | |
| $local:windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
| $local:windowsPrincipal = new-object 'System.Security.Principal.WindowsPrincipal' $local:windowsIdentity | |
| if ($local:windowsPrincipal.IsInRole("Administrators") -ne 1) | |
| { | |
| throw "add-bcd-vhd must be run from an administrator account" | |
| } | |
| $f = resolve-path $filename |
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
| using System.Runtime.CompilerServices; | |
| using Windows.Foundation; | |
| static class WinRtHelper | |
| { | |
| struct VoidValueTypeParameter { } | |
| public static TaskAwaiter GetAwaiter(this IAsyncAction op) | |
| { | |
| var tcs = new TaskCompletionSource<VoidValueTypeParameter>(); |
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
| open System | |
| // helper function to indent an indexedTextWriter and automatically un-indent | |
| // when disposed | |
| let indent (itw : System.CodeDom.Compiler.IndentedTextWriter) = | |
| let current = itw.Indent | |
| itw.Indent <- current + 1 | |
| { new IDisposable with | |
| member x.Dispose() = itw.Indent <- current } |
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
| open System | |
| // helper function to set the console collor and automatically set it back when disposed | |
| let consoleColor (fc : ConsoleColor) = | |
| let current = Console.ForegroundColor | |
| Console.ForegroundColor <- fc | |
| { new IDisposable with | |
| member x.Dispose() = Console.ForegroundColor <- current } | |
| // printf statements that allow user to specify output color |
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
| param | |
| ( | |
| [Parameter(Mandatory=$True)][string]$srcPath, | |
| [string]$dstPath = "." | |
| ) | |
| $local_path = join-path $env:LOCALAPPDATA "cppwinrt.android" | |
| if (-not (test-path $local_path)) { | |
| mkdir $local_path | out-null | |
| } |
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
| class Konsole : IDisposable | |
| { | |
| ConsoleColor _orig_fg; | |
| public static IDisposable Color(ConsoleColor fg) | |
| { | |
| var k = new Konsole() | |
| { | |
| _orig_fg = Console.ForegroundColor | |
| }; |
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 Set-ConsoleColors { | |
| param ([string]$theme = "campbell") | |
| # Following source adapted from https://github.com/Microsoft/console/tree/master/tools/ColorTool | |
| add-type -TypeDefinition @' | |
| using System; | |
| using System.Runtime.InteropServices; | |
| namespace ColorTool | |
| { |
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
| { | |
| "version": "3.6.5", | |
| "url": "https://github.com/TextAnalysisTool/Releases/raw/master/TextAnalysisTool.NET.zip", | |
| "bin": "TextAnalysisTool.NET.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
| # enhancement to https://www.microsoft.com/net/learn/get-started/linux/debian9 | |
| # debian WSL appears to need --no-check-certificate for wget from packages.microsoft.com | |
| wget --no-check-certificate -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg | |
| sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ | |
| wget --no-check-certificate -q https://packages.microsoft.com/config/debian/9/prod.list | |
| sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list | |
| # need apt-transport-https installed | |
| sudo apt-get update |
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(TARGET_CONFIG_MSVC_PCH target pch_cpp pch_header) | |
| set(pch_output_file "\"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pch\"") | |
| get_target_property(sources ${target} SOURCES) | |
| foreach(file ${sources}) | |
| if (${file} STREQUAL ${pch_cpp}) | |
| set_source_files_properties(${file} | |
| PROPERTIES | |
| COMPILE_FLAGS " /Yc${pch_header} /Fp${pch_output_file}" |