This file contains 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
Sub ProcessAttachment(item As Outlook.MailItem) | |
'An Outlook macro by Graham Mayor | |
On Error Resume Next | |
SaveAttachments item | |
lbl_Exit: | |
Exit Sub | |
End Sub | |
Private Sub SaveAttachments(olItem As MailItem) | |
'Graham Mayor - http://www.gmayor.com - Last updated - 10 Aug 2018 |
This file contains 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
Sub RemoveExtraSpaces() | |
Selection.InsertAfter "®®" | |
With Selection.Find | |
.ClearFormatting | |
.Replacement.ClearFormatting | |
.Text = "^p" | |
'What to replace it with | |
.Replacement.Text = " " | |
.Forward = True | |
.Wrap = wdFindStop |
This file contains 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
Add-Type -AssemblyName UIAutomationClient | |
Add-Type -AssemblyName UIAutomationTypes | |
$calc = [Diagnostics.Process]::Start('calc') | |
#wait for the UI to appear | |
$null = $calc.WaitForInputIdle(5000) | |
sleep -s 2 | |
$calcWindowId = ((Get-Process).where{$_.MainWindowTitle -eq 'Calculator'})[0].Id | |
$root = [Windows.Automation.AutomationElement]::RootElement | |
$condition = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::ProcessIdProperty, $calcWindowId) | |
$calcUI = $root.FindFirst([Windows.Automation.TreeScope]::Children, $condition) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#requires zenCoding.dll in \resources. Download via https://github.com/madskristensen/zencoding and compile. | |
function Get-ZenCode{ | |
[Alias("zenCode")] | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true, | |
Position=0)] | |
$zenCodeExpr, | |
[Parameter(ValueFromPipeline=$true, |
This file contains 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
Sub CrossJoinRanges() | |
Dim cn As ADODB.Connection | |
Dim sql As String | |
Dim outputSheet As Worksheet | |
Dim rs As ADODB.Recordset | |
Set rs = New ADODB.Recordset | |
Set cn = New ADODB.Connection | |
With cn | |
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _ | |
"Data Source=" & ActiveWorkbook.FullName & ";" & _ |
This file contains 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
$null = mkdir test | |
cd test | |
Install-Package -Name FlaUI.Core -ProviderName NuGet -RequiredVersion 1.3.1 -SkipDependencies -Destination $pwd -Source nuget.org | |
Install-Package -Name FlaUI.CORE -ProviderName NuGet -RequiredVersion 1.3.0 -SkipDependencies -Destination $pwd -Source nuget.org | |
Find-Package flauinspect | Install-Package |
This file contains 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
# define a format that is supported by our attribute | |
$stringDate = '4/14 4:12PM' | |
# try it first with the normal datetime type | |
[datetime]'4/14 4:12PM' | |
# this threw an error | |
# define a variable that utilizes the attribute | |
[datetime][DateTransform()]$dt = $stringDate | |
# no error | |
$dt |
This file contains 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-Registry{ | |
[CmdletBinding()] | |
[Alias("regJump")] | |
param( | |
[Parameter(Position=0)] | |
$regKey | |
) | |
#check for clipbaord only if no argument provided | |
if (!$regKey){ | |
#split the clipboard content by crlf and get of trailing crlf in case clipboard populated via piping it to clip.exe |
This file contains 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-FileVB{ | |
param( | |
[Parameter(Mandatory=$true)] | |
$url, | |
$destinationFolder="$env:USERPROFILE\Downloads", | |
[switch]$includeStats | |
) | |
Add-Type -AssemblyName Microsoft.VisualBasic | |
#resolve potential redirect |
NewerOlder