This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-ATFilter { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "EqualsSet")] | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "NotEqualSet")] | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "GreaterThanSet")] | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "LessThanSet")] | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "GreaterThanorEqualsSet")] | |
| [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "LessThanOrEqualsSet")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum Operator { | |
| Equals | |
| NotEqual | |
| GreaterThan | |
| LessThan | |
| GreaterThanorEquals | |
| LessThanOrEquals | |
| BeginsWith | |
| EndsWith | |
| Contains |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Open-GPIOPin ([int]$Pin,[ValidateSet('in','out')][string]$Mode) { | |
| [string]$Pin | Out-File -FilePath "/sys/class/gpio/export" -NoNewline | |
| $Mode | Out-File -FilePath "/sys/class/gpio/gpio$Pin/direction" -NoNewline | |
| } | |
| function Send-GPIOBit ([int]$Pin,[ValidateRange(0,1)][int]$Bit) { | |
| $Bit | Out-File -FilePath "/sys/class/gpio/gpio$Pin/value" -NoNewline | |
| } | |
| function Receive-GPIOBit ([int]$Pin) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Collects service account information from servers in a domain to a central file. | |
| .DESCRIPTION | |
| Service Account Scrobbler Script v.1.0.1 | |
| Date: Jan 2017 | |
| https://bytemech.com | |
| .NOTES | |
| Requirements: | |
| 1. Windows 2008 or higher Active Directory Powershell Module installed on local machine (script checks for this) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run this script to see connected hard disk status with nifty bar graph! | |
| $myDisk = Get-WmiObject -class win32_logicaldisk | |
| $myDisk | ForEach-Object { | |
| $free = ($_.freespace) | |
| $total = ($_.size) | |
| $used = $total - $free | |
| $perUsed = ($used / $total) * 100 | |
| $perFree = ($free / $total) * 100 | |
| $t = [math]::Round($total / 1gb) | |
| $f = [math]::Round($free / 1gb) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt install libcgi-emulate-psgi-perl libapache-session-perl libcrypt-eksblowfish-perl libconvert-color-perl libcgi-psgi-perl libcss-minifier-xs-perl libcss-squish-perl libdata-guid-perl libdata-ical-perl libbusiness-hours-perl libdate-manip-perl libdatetime-format-natural-perl libdatetime-locale-perl libdatetime-perl libdata-page-pageset-perl libdate-extract-perl libdbi-perl libdbix-searchbuilder-perl libdevel-globaldestruction-perl libdevel-stacktrace-perl libemail-address-list-perl libemail-address-perl libcrypt-ssleay-perl libdbd-mysql-perl libcrypt-x509-perl libfcgi-perl libfile-sharedir-perl libfile-which-perl libgd-graph-perl libgd-perl libgd-text-perl libgnupg-interface-perl libgraphviz-perl libhtml-formattext-withlinks-andtables-perl libhtml-formattext-withlinks-perl libhtml-mason-perl libhtml-mason-psgihandler-perl libhtml-quoted-perl libhtml-rewriteattributes-perl libhtml-scrubber-perl libhttp-message-perl libipc-run3-perl libipc-run-perl libjavascript-minifier-xs-perl libjson-perl liblocale-maketex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From https://communary.net/2014/12/21/show-calendar-cal-for-powershell/ | |
| function Show-Calendar { | |
| <# | |
| .SYNOPSIS | |
| Show calendar. | |
| .DESCRIPTION | |
| This function is a PowerShell version of the *NIX cal command and will show a | |
| calendar of the chosen month(s). The current day will be marked with a '*'. | |
| For best results, use together with the FormatPx module by Kirk Munro. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Users = Get-ADUser | |
| $GroupData = Import-Clixml -Path ".\Groups.clixml" | |
| $GroupsToAdd = $Users | ForEach-Object { | |
| $User = $_ | |
| $Company = $GroupData.Companies | Where-Object {$_.Name -eq $User.Company} | |
| $Departments = $Company.Departments | Where-Object {$_.Name -eq $User.Department} | |
| $Departments.Groups | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get the asterisk-extra-sounds-en-wav-current.tar.gz file or the one for your language | |
| # Extract to a folder, example C:\Temp\asterisk-extra-sounds-en-wav-1.5\ | |
| $AsteriskAudioFolder = "C:\Temp\asterisk-extra-sounds-en-wav-1.5\" | |
| function Out-Audio { | |
| [CmdletBinding()] | |
| param ( | |
| [string[]] | |
| $FilePath | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-ConfigData { | |
| Param( | |
| $Path = "$env:TEMP\MyScriptDefaultCredStore.config.clixml" | |
| ) | |
| if (Test-Path -Path $Path) { | |
| # Open Config file if exists | |
| $ConfigData = Import-Clixml $Path | |
| } | |
| else { | |
| # Create Config file if does not exists |