PowerShell

Sending Text to Clipboard Everywhere using Powershell

In a previous tip you learned how to use clip.exe to send results to the clipboard. But what if you don’t have clip.exe (let’s say on Windows XP) or don’t want dependencies? Here’s a clever alternative: function Out-Clipboard {  param(   $text  )  Add-Type -AssemblyName System.Windows.Forms  $tb = New-Object System.Windows.Forms.TextBox  $tb.Multiline = $true        if… Continue reading Sending Text to Clipboard Everywhere using Powershell

PowerShell

Reading the Clipboard using Powershell

  PowerTip of the Day, from PowerShell.com:   What if you wanted to paste information from the clipboard? No sweat, here is a Get-Clipboard function that outputs any text held by the clipboard: function Get-Clipboard {  Add-Type -AssemblyName System.Windows.Forms  $tb = New-Object System.Windows.Forms.TextBox  $tb.Multiline = $true  $tb.Paste()  $tb.Text } In a previous tip we presented… Continue reading Reading the Clipboard using Powershell

PowerShell

Bulk-Creating PDF Files from Word

  PowerTip of the Day, from PowerShell.com:   To convert a whole folder full of MS Word documents to PDF, here’s a function that might help: function Export-WordToPDF {   param(   [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]   [Alias(“FullName”)]   $path,   $pdfpath = $null)   process {     if (!$pdfpath) {       $pdfpath = [System.IO.Path]::ChangeExtension($path, ‘.pdf’)     }… Continue reading Bulk-Creating PDF Files from Word

PowerShell

Creating Your Own Get-Driver Tool using PowerShell

  PowerTip of the Day, from PowerShell.com:   Creating Your Own Get-Driver Tool Some code snippets are really valuable, so you should turn them into functions to keep around as new PowerShell commands. Here’s a sample function: function Get-Driver {   param(     $Keyword = ‘*’   )   $col1 = @{Name=‘File Name’; Expression={ Split-Path… Continue reading Creating Your Own Get-Driver Tool using PowerShell