The SMSL lines of products uses these NEC32 extended format ir codes.
Remote | Address | Address (rev) |
---|---|---|
A | 3412h | 482Ch |
B | 3512h | 48ACh |
C | 3612h | 486Ch |
"use client"; | |
/* eslint-disable @next/next/no-img-element */ | |
import Link from "next/link"; | |
import { useState, useEffect } from 'react'; | |
import { | |
AppBskyFeedDefs, | |
AppBskyFeedPost, | |
type AppBskyFeedGetPostThread, | |
} from "@atproto/api"; |
#requires -module Az.Functions | |
function Write-CmdletError { | |
param($message, $cmdlet = $PSCmdlet) | |
$cmdlet.ThrowTerminatingError( | |
[Management.Automation.ErrorRecord]::new( | |
$message, | |
'CmdletError', | |
'InvalidArgument', |
PowerShell has a problem with it's extra output streams. The actual content of the Warning, Verbose, Debug, Information, and even Error streams doesn't have the label text like "WARNING: " or "VERBOSE: " that we're used to seeing in the host. That label is actually added by the host (hopefully, in a culture-aware way). However, this means that when you attempt to redirect all of this output, for example by redirecting all output streams to stdout, with *>&1
, you don't get labels on them at all, which is confusing, and can make the output difficult to comprehend.
Take for example a function that writes in a loop:
if ($i % 5 -eq 0) {
Write-Output $i
} else {
Write-Verbose $i
}
using namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions | |
using namespace System.Management.Automation.Language | |
using namespace System.Management.Automation | |
using namespace System.Collections.Generic | |
using namespace System.Collections | |
[AttributeUsage("Property,Field")] | |
class SubscriptionNameCompleter : ArgumentCompleterAttribute { | |
# PowerShell expects you to write IArgumentCompleter and register them with this syntax: | |
# [ArgumentCompleter([MyIArgumentCompleter])] |
function Get-DadJoke { | |
[cmdletBinding()] | |
Param() | |
process { | |
$header = @{ | |
Accept = "application/json" | |
} | |
$joke = Invoke-RestMethod -Uri "https://icanhazdadjoke.com/" -Method Get -Headers $header | |
# Unifi Controller Login Base URI | |
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443' | |
# Identifier of the site in UniFi. Set to default for the default site | |
$uSiteID = "default" | |
$uUsername = 'adminuser' # yourAdmin UserID | |
$uPassword = 'yourPassword' # yourAdmin User Password | |
$uAuthBody = @{"username" = $uUsername; "password" = $uPassword } | |
$uHeaders = @{"Content-Type" = "application/json" } |
// Mercules' Erentil FR4 breakdown | |
// https://www.reddit.com/r/DestinyTheGame/comments/cbxao7/massive_breakdown_of_erentil_fr4_including_stats/ | |
// Erentil FR4 | |
dimwishlist:item=3027844941&perks=194952923,3868766766,280464955,1600092898 | |
dimwishlist:item=3027844941&perks=194952922,3868766766,280464955,1600092898 | |
dimwishlist:item=3027844941&perks=194952923,2969185026,280464955,1600092898 | |
dimwishlist:item=3027844941&perks=194952922,2969185026,280464955,1600092898 | |
dimwishlist:item=3027844941&perks=194952923,3868766766,1645158859,1600092898 | |
dimwishlist:item=3027844941&perks=194952922,3868766766,1645158859,1600092898 |
How would you count the "Lines of Code" in HowManyLines.ps1 below? Go ahead and look, I'll wait here. 😉 Do you count lines that have nothing but braces on them? Do you count opening and closing braces? Do you count the "else" line?
If we use the Language Parser to count lines, we can take every statement's begin and end line and then count how many unique lines have code on them. But suprisingly, the else
keyword doesn't show up as a token, because it's just part of the IfStatementAst
...
$Ast = [System.Management.Automation.Language.Parser]::ParseFile((Convert-Path "HowManyLines.ps1"), [ref]$Null, [ref]$Null)
function Prompt { | |
<# | |
.Synopsis | |
Your custom PowerShell prompt | |
# borrowing heavily from https://dbatools.io/prompt but formatting the execution time without using the DbaTimeSpanPretty C# type | |
.Description | |
Custom prompt that includes the following features: |