Skip to content

Instantly share code, notes, and snippets.

View spjeff's full-sized avatar

Jeff Jones spjeff

View GitHub Profile
Start-Process powershell.exe -Credential "DOMAIN\USER" -NoNewWindow -ArgumentList "Start-Process powershell.exe -Verb runAs"
https://aka.ms/spfarminfo
https://github.com/acasilla/SPFarmInfo/releases/download/v2.0/Get-SPFarmInfo.ps1
choco install 7zip -y
choco install dotnetfx -y
choco install git -y
choco install GoogleChrome -y
choco install notepadplusplus -y
choco install notepadreplacer --params='"/NOTEPAD:C:\Program Files\Notepad++\notepad++.exe"' -y
choco install sql-server-management-studio -y
choco install visualstudiocode -y
choco install ulsviewer -y
choco install visualstudio2022community -y
Import-Module Sharegate
$csvFile = "C:\CSV\CopyContent.csv"
$table = Import-Csv $csvFile -Delimiter ","
$srcUsername = "sourceusername"
$srcPassword = ConvertTo-SecureString "sourcepassword" -AsPlainText -Force
$dstUsername = "destinationusername"
$dstPassword = ConvertTo-SecureString "destinationpassword" -AsPlainText -Force
cinst 7zip -y
cinst adobereade -y
cinst ccleaner -y
cinst dotnet4.7.2 -y
cinst dotnetfx -y
cinst eraser -y
cinst fiddler -y
cinst git -y
cinst github-desktop -y
cinst GoogleChrome -y
<html>
<body>
<h1>ASP TEST PAGE</h1>
<p>
<b>You are browsing this site with:</b>
<%Response.Write(Request.ServerVariables("http_user_agent"))%>
</p>
<p>
<b>Your IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_addr"))%>
' from https://howtouseexcel.net/how-to-extract-a-url-from-a-hyperlink-on-excel
Function GetURL(cell As range, _
Optional default_value As Variant)
'Lists the Hyperlink Address for a Given Cell
'If cell does not contain a hyperlink, return default_value
If (cell.range("A1").Hyperlinks.Count <> 1) Then
GetURL = default_value
Else
GetURL = cell.range("A1").Hyperlinks(1).Address & "#" & cell.range("A1").Hyperlinks(1).SubAddress
End If
// from https://stackoverflow.com/questions/827368/using-the-get-parameter-of-a-url-in-javascript
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
# from https://www.vembu.com/blog/running-hyper-v-in-azure-nested-virtualization/
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
New VMSwitch -Name "InternalNATSwitch" -SwitchType Internal
Get-NetAdapter
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 14
New-NetNat -Name "InternalNAT" -InternalIPInterfaceAddressPrefix 192.168.00/24
Test-NetConnection
# PowerShell $profile as of 05-26-2017
# Working Path
cd\
cd code
# Chocolatey
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"