top of page

You can use a simple Powershell command - get-process - to get a list of all programs that are currently running on a Windows PC. Simply opening the PowerShell ISE (Intergrated Scripting Environment) and typing in the console pane:

Get-process

. . . will generate a list of programs currently running and give you information on how much memory they are using. [If you are running Windows 7 or later PowerShell ought to be already installed.] You can use this more specific command to get more practical information about running software:

Get-process |Select-Object name, fileversion, productversion, company

Appending the script with an export command like this:

Get-Process | Select-Object name, fileversion, productversion, company | Export-Csv test.csv

. . . will output the results to an Excel .csv file that you can find in the user's default folder at C:\Users


 
 

Some simple PowerShell commands will let you securely copy individual files in PowerShell. Enter command Copy--Item followed by the source file path and '-destination' followed by the path of the folder you are copying the file to. See this example:

Copy-Item c:\FooFolder\hiddenlist.txt -destination c:\backup

If you want to copy a folder and all of the subfolders inside it you can add the switch -recurse to the end. Adding the switch -force will allow for any existing files to be overwritten. So if we enter this PowerShell script:

copy-item -path "C:\foofolder2" -destination "c:\backup" -recurse

. . . this folder:

. . .will be fully copied here:



 
 

The PowerShell script posted to this site, will allow you take files saved to your My Documents folder and print them as landscaped PDFs. Follow the instructions on how to use PowerShell posted in the Tip of the Night for July 24, 2015 . You can change the setting of $homedocuments = "C:\Users\YourUserName\Documents" to whatever folder you specify.

Function PrintXL($FileName) {

$xlPortrait = 1

$xlLandscape = 2

$xlPrintNoComments = -4142

$xlPaperLetter = 1

$xlPaperLedger=4

$xlPaperLegal = 5

$xlPaperFolio=14

$xlPaper11x17=17

$xlDownThenOver = 1

$xlAutomatic = -4105

$xl = New-Object -comobject excel.application

$xl.Visible = $true

$xl.DisplayAlerts = $False

$wb = $xl.Workbooks.Open($FileName)

$ws = $wb.Worksheets.Item(1)

#== PRINT SETUP TO FIT DATA TO ONE PAGE

$ws.PageSetup.PrintTitleRows = "$1:$1"

$ws.PageSetup.PrintTitleColumns = ""

$ws.PageSetup.LeftHeader = ""

$ws.PageSetup.CenterHeader = "&""MS Sans Serif,Bold""&14&A"

$ws.PageSetup.RightHeader = ""

$ws.PageSetup.LeftFooter = ""

$ws.PageSetup.CenterFooter = "Page &P"

$ws.PageSetup.RightFooter = ""

$ws.PageSetup.LeftMargin = $xl.InchesToPoints(0.25)

$ws.PageSetup.RightMargin = $xl.InchesToPoints(0.25)

$ws.PageSetup.TopMargin = $xl.InchesToPoints(0.5)

$ws.PageSetup.BottomMargin = $xl.InchesToPoints(0.5)

$ws.PageSetup.HeaderMargin = $xl.InchesToPoints(0.25)

$ws.PageSetup.FooterMargin = $xl.InchesToPoints(0.25)

$ws.PageSetup.PrintHeadings = $False

$ws.PageSetup.PrintGridlines = $true

$ws.PageSetup.PrintComments = $xlPrintNoComments

# $ws.PageSetup.PrintQuality = 600 $ws.PageSetup.CenterHorizontally = $FALSE

$ws.PageSetup.CenterVertically = $FALSE

$ws.PageSetup.Orientation = $xlLandscape

$ws.PageSetup.Draft = $False

$ws.PageSetup.PaperSize = 5

$ws.PageSetup.FirstPageNumber = $xlAutomatic

$ws.PageSetup.Order = 1

$ws.PageSetup.BlackAndWhite = $FALSE

$ws.PageSetup.Zoom = $False

$ws.PageSetup.FitToPagesWide = 1

$ws.PageSetup.FitToPagesTall = 9999

$range = $ws.usedRange

$r = $range.rows.count

$c = $range.Columns.count

$S = $ws.Cells.Item($r,$c)

$S = $S.Address()

$U = $ws.Cells.Item(1, 1)

$U = $U.Address()

$T = $U + ":" + $S

$ws.PageSetup.PrintArea = $T

$ws.Printout()

$wb.Close(0)

# Quit Excel

$xl.quit()

spps -n excel

}

$homedocuments = "C:\Users\YourUserName\Documents"

# Windows 7 does not have a %homedocuments%

$s = dir $homedocuments\*.xls? -Recurse

$s | foreach -process {

Write-Host $_

PrintXL($_)

}


 
 

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page