Open and close a process with Powershell

Short script to open notepad.exe (can be any process you want to open) on either your local machine or a remote machine and then kill the process. Option 1 C:\PSTools\PsExec.exe cmd /c start notepad.exe Start-Sleep -s 10 C:\PSTools\PsKill.exe -accepteula notepad.exe Option 2 C:\PSTools\PsExec.exe notepad.exe Start-Sleep -s 10 C:\PSTools\PsKill.exe -accepteula notepad.exe Continue Reading

Adding the date to a filename with Powershell

Following on from my previous post, Write to a text file using Powershell, I found it useful to be able to include the date into the log filename. $LogFile =”C:\PsTools\Method01-$(get-date -f yyyy-MM-dd).log” $DateTime = Get-Date Write-Output $DateTime “Performing some operation” | Add-Content $LogFile You can see from this script that Continue Reading

Information Technology Infrastructure Library (ITIL)

Independent set of standards and practices for running I.T department. Details processes that should exist and what best practise is. Provides standard for I.T. departments to use for benchmarking and measuring their performance. ITIL areas cover: Financial management for I.T. department Service design Service level management Availability management Capacity management Continue Reading

Write to a text file using Powershell

While looking for a method to generate some logging in a Powershell script to aid debugging I came across several suggestions… #Method 01 – appends contents $LogFile =”C:\PsTools\Method01.log” $DateTime = Get-Date Write-Output $DateTime “Performing some operation” | Add-Content $LogFile #Method 02 – appends contents Add-Content “C:\PsTools\Method02.log” “Performing some operation” #Method Continue Reading

Planning Tools

Tools used to support I.T. department planning, range from Excel to Project or even more specialised products. Choice depends on size and complexity of project. MS Project can link several projects together under one steering project facilitating project management. Many tools can also provide costings for the projects to assist Continue Reading

Software Management Tools

Many tools available to help manage I.T. departments, both simple and complex. Can be stand alone for specific functions or fully integrated systems covering areas such as: Code repository Asset repository Help desk Data models repository Software analysis and design repositories