I hereby claim:
- I am devblackops on github.
- I am devblackops (https://keybase.io/devblackops) on keybase.
- I have a public key ASDd4DO8BeRC7l3kECkdj8Z6NHEdIeP0dNK50DRr1sBWUwo
To claim this, I am signing this object:
# Put these functions in the profile.ps1 to start and stop Chrome usage tracking. | |
# Display your Chrome usage by running "Show-ChromeUsage" | |
# Track Chrome usage | |
function Start-ChromeUsageTracking { | |
$job = Start-Job -Name ChromeTracker -ScriptBlock { | |
while ($true) { | |
$now = [datetime]::Now.ToString('s') | |
$tabs = (Get-Process chrome -ErrorAction SilentlyContinue).Count | |
$log = Join-Path ([IO.Path]::GetTempPath()) 'chrome_usage.csv' |
<# | |
.SYNOPSIS | |
Suggest Slack threads for talkative users. | |
.DESCRIPTION | |
This middleware tracks how many messages (x) users send per (y) amount of time. | |
If a user goes over the threshold, we'll send a message suggesting that Slack threads should be used. | |
.NOTES | |
Based on https://stackoverflow.com/questions/667508/whats-a-good-rate-limiting-algorithm | |
#> | |
param( |
param( | |
$Context, | |
$Bot | |
) | |
$user = $Context.Message.FromName | |
$adGroup = 'botusers' | |
$userGroups = (New-Object System.DirectoryServices.DirectorySearcher("(&(objectCategory=User)(samAccountName=$user)))")).FindOne().GetDirectoryEntry().memberOf | |
if (-not ($userGroups -contains $adGroup)) { |
<?xml version="1.0" encoding="utf-8" ?> | |
<Configuration> | |
<ViewDefinitions> | |
<View> | |
<Name>ComputerInformation</Name> | |
<ViewSelectedBy> | |
<TypeName>ComputerInformation</TypeName> | |
</ViewSelectedBy> | |
<TableControl> | |
<TableHeaders> |
function Get-PerformanceCounter { | |
[cmdletbinding(DefaultParameterSetName = 'Computer')] | |
param( | |
[parameter( | |
ParameterSetName = 'Computer', | |
ValueFromPipeline = $true | |
)] | |
[ValidateNotNullOrEmpty()] | |
[Alias('Name')] |
function Get-BlogXmlFeed { | |
<# | |
.SYNOPSIS | |
Returns posts from the PowerShell.org (or other blog) XML feed. | |
.DESCRIPTION | |
Returns posts from the PowerShell.org (or other blog) XML feed and optionally opens the post link in the browser or displays the raw HTML. | |
.PARAMETER Uri | |
The XML feed URI to retrieve. | |
.PARAMETER OpenIn | |
Open post link in the operating systems' default browser or display the raw HTML. |
function Get-MonitorDetail { | |
[OutputType('MonitorDetail')] | |
[cmdletbinding()] | |
param( | |
[parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[Alias('Name')] | |
[string[]]$ComputerName = $env:COMPUTERNAME, | |
[System.Management.Automation.CredentialAttribute()] | |
[pscredential]$Credential |
I hereby claim:
To claim this, I am signing this object:
function Url { | |
[PoshBot.BotCommand( | |
Command = $false, | |
TriggerType = 'Regex', | |
Regex = '^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}[^ ]+' | |
)] | |
[cmdletbinding()] | |
param( | |
[parameter(Mandatory, ValueFromRemainingArguments)] | |
[object[]]$Arguments, |
Add-Type -TypeDefinition @" | |
namespace PoshBot { | |
public class BotCommand : System.Attribute { | |
public string Description { get; set; } | |
} | |
} | |
"@ | |
function Foo { | |
[PoshBot.BotCommand(Description = 'This is a custom function description')] |