When you assign something to a variable, you can enclose the expression in braces. This will also output the data. Have a look: $a = Get-Service ($a...
Month: January 2014
Pinging Computers
There are multiple ways how you can ping computers. Here is a simple approach that uses the traditional ping.exe but can be easily integrated into...
Playing a Sound on Error
To catch a user’s attention, your script can easily play WAV sound files. Here is a simple function: function Play-Alarm { $path =...
Getting DNS IP Address from Host Name
There is a tiny .NET function called GetHostByName() that is vastly useful. It will look up a host name and return its current IP address:...
Reading and Writing NTFS Streams
When a file is stored on a drive with NTFS file system, you can attach data streams to it to store hidden information. Here is a sample that hides...
Customizing and Creating VCL Styles
Delphi, C++Builder and RAD Studio include various VCL styles out of the box. These can be used for your Windows applications and customized via the...
Create New Local Admin Account on the Fly
Ever needed a new local administrator account for testing purposes? Provided you are already Administrator, and you opened a PowerShell with full...
Launching Any Excel Version
Microsoft Excel is an example of a program that is not easy to launch directly: the path to Excel may be different, depending on Office version and...
Unblocking Download Files
Any file you download from the Internet or receive via email get marked by Windows as potentially unsafe. If the file contains executables or...
Eliminating Empty Results
To exclude results that have empty properties, you can easily use Where-Object. For example, when you run Get-Hotfix, and you only want to see...
Hidden Array Extensions in PowerShell 4.0
PowerShell 4.0 (final version as found in Windows 8.1) has Foreach and Where built directly into arrays. This is a geek stuff, so there is no...
Opening Files in ISE Editor
If you'd like to open a script in the ISE editor, one quick way is using the command "ise". For example, to open your profile script...
Using the REST Debugger will help you prototype your Delphi and C++ REST apps
As part of the new addition of the REST Client Library components in Delphi, C++Builder and RAD Studio XE5, we also include a REST Debugger so that...
Block Comment in PowerShell ISE
Beginning in PowerShell 3.0, when you press and hold ALT and then select something, you get a block selection. If you make this selection as narrow...
Finding Logged-On User on Remote Machine
In a previous tip we used quser.exe to find the currently logged-on user on the local machine. Here is now a function that also allows us to find...
Five Must-Have Tools For DBA’s
SQL Diagnostic Manager SQL diagnostic manager is a full, feature-rich monitoring solution for your SQL Server and virtualization platform with...
Finding Logged-On User
There is a helpful console application called quser.exe which will tell you who is logged on to a machine. The executable returns plain text, but...
Finding Logon Failures
Whenever someone logs on with invalid credentials, there will be a log entry in the security log. Here is a function that can read these events from...
Percentage Of Full Table Scans.
We are hitting over 50% on our master database for full table scans. Would queries like this: SELECT DATE_FORMAT(now(),'%Y%m%d') as today,...
Change Desktop Wallpaper
To change the current desktop wallpaper and make this change effective immediately, PowerShell can tap into the windows API calls. Here is a...
Fun with FireMonkey Gradients
Everybody loves colours. Great apps should use colours in clever and original ways. I have been recently spending a lot of time using Delphi XE5 for...
Getting System Information for Remote Systems
In a previous tip you learned how systeminfo.exe can compose a rich system profile. systeminfo.exe has built-in remoting capabilities, so provided...
Android Bluetooth SPP / RS232 with Delphi XE5 YouTube video and examples
I found this great Delphi XE5 Android Bluetooth YouTube video, by Björn Hansen, from back in September last year after the launch of Delphi XE5. it...
Using Block Comment in the ISE Editor
There is a little known trick that you can use to block-prepend or block-remove characters in the ISE editor. This feature was introduced in...