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
// .\CompileSimply-CSharp.ps1 . RunAsFromFile.cs "64" "System.Diagnostics.Process.dll" | |
// | |
// From https://social.technet.microsoft.com/Forums/lync/en-US/132e170f-e3e8-4178-9454-e37bfccd39ea/startprocess-verb-runas-amp-credential | |
// $pw= convertto-securestring "PASSWORD" -asplaintext –force | |
// $pp = new-object -typename System.Management.Automation.PSCredential -argumentlist "DOMAIN\user",$pw | |
// $script = "c:\pathtoscript.ps1" | |
// Start-Process powershell -Credential $pp -ArgumentList '-noprofile -command &{Start-Process $script -verb runas}' | |
// $pw= convertto-securestring "PASSWORD" -asplaintext –force | |
// $pp = new-object -typename System.Management.Automation.PSCredential -argumentlist "DOMAIN\user",$pw | |
// $script = "c:\pathtoscript.ps1" |
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( | |
[string]$dir, | |
[string]$x64 # "64" for x64 compiler, "" for 32bit | |
) | |
. "$dir\CompileSimply-CSharp.ps1" $dir wdscli.cs $x64 "" | |
. "$dir\CompileSimply-CSharp.ps1" $dir cliphtml.cs $x64 WPF\PresentationCore.dll | |
. "$dir\CompileSimply-CSharp.ps1" $dir RunAsFromFile.cs $x64 System.Diagnostics.Process.dll |
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
/* Compiling this needs a reference to the PresentationCore dll: | |
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "/reference:c:\windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationCore.dll" "/out:cliphtml.exe" cliphtml.cs | |
*/ | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Windows; // Needed to access the clipboard. | |
namespace SetClipBoardToHtml |
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( | |
[string]$dir, | |
[string]$f, | |
[string]$x64, # "64" for x64 compiler, "" for 32bit | |
[string]$extraRef | |
) | |
Write-Host 'looking for C# compiler' -nonewline | |
# Get latest directory into $v | |
$v = "" |
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.Data.OleDb; | |
using System; | |
class WDSCli | |
{ | |
static void Main(string[] args) | |
{ | |
int maxResults = 200; // Don't output more than this amount of results | |
bool help = args.Length == 0; | |
string searchRoot = ""; // limit scope of search |