Skip to content

Instantly share code, notes, and snippets.

View pldmgg's full-sized avatar

Paul DiMaggio pldmgg

View GitHub Profile
@pldmgg
pldmgg / Win16Chef_WinRMConfig.ps1
Created December 2, 2017 15:18
Win16Chef_WinRMConfig
WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Service
Type Name SourceOfValue Value
---- ---- ------------- -----
System.String RootSDDL O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
System.String MaxConcurrentOperations 4294967295
System.String MaxConcurrentOperationsPerUser 1500
System.String EnumerationTimeoutms 240000
System.String MaxConnections 300
System.String MaxPacketRetrievalTimeSeconds 120
@pldmgg
pldmgg / Sanitized-UpdatePackageManagement.ps1
Last active January 24, 2019 02:30
Update-PackageManagement_PowerShellCore_Errors
function Check-Elevation {
if ($PSVersionTable.PSEdition -eq "Desktop" -or $PSVersionTable.Platform -eq "Win32NT") {
[System.Security.Principal.WindowsPrincipal]$currentPrincipal = New-Object System.Security.Principal.WindowsPrincipal(
[System.Security.Principal.WindowsIdentity]::GetCurrent()
)
[System.Security.Principal.WindowsBuiltInRole]$administratorsRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator
if($currentPrincipal.IsInRole($administratorsRole)) {
return $true
@pldmgg
pldmgg / NoClutter-NetworkMonitor.png
Last active September 4, 2017 20:51
NoClutter-NetworkMonitor Screenshot
NoClutter-NetworkMonitor.png
@pldmgg
pldmgg / VSCodeOmniSharp.md
Last active August 30, 2017 16:18
VSCodeOmniSharpImage

For context, please screenshot here: https://gist.githubusercontent.com/pldmgg/b87938d21ab9a0b0ab959d6ec12a967c/raw/b8e29882b6f0c0f4819dfd1bcb30f535297fd9e7/VSCodeOmniSharpIssue.png

When I hover over StructuredDataConfig.ParseJsonString in the below screeenshot below, I get a pop-up that says...

Assembly 'OpenScraping' with identity 'OpenScraping, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [OpenScrapingTest_For_dotnet-script_cli.csx]

Also, as you can see in the PowerShell terminal in the screenshot, when I run dotnet script, I get the following... (see project branch I'm using here: https://github.com/filipw/dotnet-script/tree/feature/netcore20) (and also OpenScraping here: https://github.com/Microsoft/openscraping-lib-csharp)

@pldmgg
pldmgg / launch.json
Last active August 30, 2017 11:04
OpenScrapingProject .vscode launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Script Debug",
"type": "coreclr",
"request": "launch",
"program": "${env:ProgramFiles}\\dotnet\\dotnet.exe",
"args": [
"exec",
@pldmgg
pldmgg / OpenScrapingTest_For_scriptcs_cli.csx
Created August 30, 2017 11:02
OpenScrapingTest_For_scriptcs_cli.csx
#r "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll"
#r "System"
#r "System.Core"
#r ".\scriptcs_packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll"
#r ".\scriptcs_packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll"
#r "System.Collections"
#r ".\scriptcs_packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll"
#r ".\scriptcs_packages\OpenScraping.1.0.1\lib\netcoreapp2.0\OpenScraping.dll"
#r ".\scriptcs_packages\HtmlAgilityPack.1.5.1\lib\netstandard1.6\HtmlAgilityPack.dll"
@pldmgg
pldmgg / OpenScrapingTest_For_dotnet-script_cli.csx
Created August 30, 2017 10:57
OpenScrapingTest_For_dotnet-script_cli.csx
#r "nuget:Newtonsoft.Json,10.0.3"
#r "nuget:OpenScraping,1.0.1"
#r "nuget:System.Runtime,4.3.0"
using System;
using Newtonsoft.Json;
using OpenScraping;
using OpenScraping.Config;
var configJson = @"
@pldmgg
pldmgg / project.json
Created August 30, 2017 10:55
OpenScrapingProject project.json
{
"version": 3,
"frameworks": {
"netcoreapp2.0": {
"dependencies": {
"OpenScraping": "1.0.1",
"Newtonsoft.Json": "10.0.3",
"System.Runtime": "4.3.0"
}
}
@pldmgg
pldmgg / OpenScrapingTest.csproj
Created August 30, 2017 10:54
OpenScrapingTest.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0</RuntimeFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent></PreBuildEvent>
</PropertyGroup>
@pldmgg
pldmgg / Get-NuGetDLL.ps1
Last active August 18, 2017 17:20
Inspect a downloaded .nupkg and find the "best" .dll version to use. Also output list of compatible platforms.
function Get-NuGetDLL {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false)]
[string]$PathToZip = $(Read-Host -Prompt "Please enter the full path to a .nupkg or .zip file")
)
<#
# Reference: https://docs.microsoft.com/en-us/dotnet/standard/net-standard