PowerShell

Creating Shares Remotely using Powershell

  PowerTip of the Day, from PowerShell.com:   Let’s assume you need to access another machine’s file system but there is no network share available. Provided you have local administrator privileges and WMI remoting is allowed in your Firewall, here is a one-liner that adds another share remotely: PS> ([wmiclass]‘\\storage1\root\cimv2:Win32_Share’).Create(‘c:\’, ‘Hidden’, 0, 12, ‘secret share‘).ReturnValue… Continue reading Creating Shares Remotely using Powershell

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

PowerShell

Finding Driver Information using PowerShell

  PowerTip of the Day, from PowerShell.com: driverquery.exe returns all kinds of information about installed drivers, but the information seems a bit useless at first: PS> driverquery.exe /V   Module Name     Display Name                  Description                   Driver Type         Start Mode State          St ============ ================  ================== ============= ========== =======  == 1394ohci           OHCI-konformer 1394–Ho OHCI-konformer 1394–Ho Kernel    Manual         Stopped     OK20.11.2010… Continue reading Finding Driver Information using PowerShell