Source: https://github.com/orgs/community/discussions/16925
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
using namespace System.Management.Automation | |
using namespace System.Collections | |
function ConvertFrom-Format { | |
<# | |
.SYNOPSIS | |
Converts Format-Table output to a format that can be used with Add-FormatTable | |
#> | |
param( | |
#The name of the format view definition assigned to the format data. Default is 'CustomTableView | |
[ValidateNotNullOrEmpty()][string]$Name = 'CustomTableView', |
#requires -version 7 | |
#You can load this script with $(iwr https://tinyurl.com/TraceAICommand | iex) | |
using namespace Microsoft.ApplicationInsights | |
using namespace Microsoft.ApplicationInsights.Extensibility | |
using namespace Microsoft.ApplicationInsights.DataContracts | |
using namespace System.Management.Automation | |
using namespace System.Collections.Generic | |
using namespace System.Net | |
#Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/app/console |
Source: https://github.com/orgs/community/discussions/16925
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
Function Get-MACAddress { | |
Param( | |
[Switch]$Local, | |
[String]$ComputerName | |
) | |
if ($Local) { | |
$MACAddress = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'" | Select-Object -ExpandProperty MACAddress | |
} else { | |
$MACAddress = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'" -ComputerName $ComputerName | Select-Object -ExpandProperty MACAddress |
####################################################### | |
## | |
## Wake.ps1, v1.0, 2013 | |
## | |
## Adapted by Ammaar Limbada | |
## Original Author: Matthijs ten Seldam, Microsoft (see: http://blogs.technet.com/matthts) | |
## | |
####################################################### | |
<# |
User-Report-V4 |
User-Report-V4 |
#URL that needs to be fetched | |
$url = "https://site.state.gov/default.aspx" | |
#get the server name in case the process jumps to another script | |
$serverName = $env:computername | |
#wrapped it into a try/catch for some type of error handling | |
TRY { | |
#use invoke-webrequest to fetch a session from the site | |
Invoke-WebRequest $url -SessionVariable session -UseBasicParsing |