Checking how may times a substring appears in a string.
Hello All,I am a big fan of RegEx (always trying to learn something new), and though I would post this tip (by the way how do you post tips on the poweshell tips section?)If you have a string like this...
View ArticleAligning columns in Out-GridView
Hi Folks,I've created a PowerShell script to display logical disk information on a local or remote computer.Is it possible to right align a column in a grid?I use PowerShell version...
View ArticleArrays with Holidays dates
have the ps script to verify he content of file Monday- Friday at 8:00 PM except holidays . If the word imported is not found in the text m-f I want to send an email.Need guidance on how to finish...
View ArticleCompare files between 2 folders?
A company sales employee has left our company to go to a competitor. He has files in on his work laptop local hard drive. We are trying to establish if there are any files that exist on his computer...
View ArticleProblem with populating Excel Spread Sheet
HiI'm able to populate a spread sheet with the info from one array but not able to populate the info from the 2nd array:Code:$Servers = Get-Content .\EMA.txt$Dir1 =...
View ArticleCapturing Text from a string into seperated names groups and outputing the...
Hello AllRecently I posted a quick example of "Checking how may times a substring appears in a string" using RegEx and the experts on the forum kindly following up with some examples using...
View ArticlePassing data to/from an event action in script
I have just finished reading Learn Powershell Toolmaking in a Month of Lunches by Don and Jeff. Good book Don and Jeff, I picked up a few pointers that I can use in future scripts. I came across a...
View Articleadd computers to an ad group based on the members of another ad group
i hope the title of this post isnt very confusing... at work, all our computers have names based on the users username, and what i need to do is to update an AD group with the computernames belonging...
View ArticleHow to look for a word/phrase in a string as long as another word/phrase does...
Normal 0 false false false EN-GB X-NONE X-NONEHelloJust thought I would post this as this was something I was previously stuck on (hope that's OK)If you want to match a word/phrase (any regex...
View ArticleComputer inventory script
Greetings everyone,I've hacked together a script to get some basic computer info using wmi. The below script works, the problem I have is getting the IP address info. I don't get any error just don't...
View Articleslow script
Hello experts I spent some time constructing the below script to retrieve BIOS data from remote computers.however, the script seems to run for a very long time, I mean hours...While it runs, the excell...
View ArticleCreating Custom Objects in different parts of the script
So, I have a script that i'm working on that I want to create custom objects based on results of part of the script for example.. I have a list of servers, lets say 10 servers$servers = gc...
View ArticleIssues with the Contains Method of System.String
I am writing a tool that requires me to categorize text files based on the values supplied at a given portion of the file. Specifically, on line 26 of the file there is a statement such...
View ArticleCan someone help me edit the script
The following script is supposed to give me disk space usage on my serverlist in a nice html format. But it does not work. Here's the script. I truly appreciate your help.. #requires -version 2.0...
View ArticleLastWriteTime
Does someone have an example on how I can conmpare files in two remote shares by the LastWriteTime property?...maybe by using the Get-ChildItem cmdlet?
View ArticlePing once every 5 seconds
ping computername /t | % {$_; Start-Sleep -Seconds 5} Does this command send a ping once every 5 seconds to the computer? Or dose the "ping computername /t" keep going then feeds the data to the...
View ArticleUsing Sql to perform windows update and schedule server reboots
I would like to use a sql database to query the reboot time of a computer and based on that info, perform windows update and reboot the server. The reason of using sql is for each computer may have...
View ArticleBash-like Tab Completion in PowerShell
When PowerShell first came on the scene, Unix folks were among the first to notice. They’d enjoyed a powerful shell and a vigorous heritage of automation for years – and “when I’m forced to use...
View ArticleRunning the WACK tool using Powershell 2012 in Windows 8 to test a Windows...
I’ve been having problems running the app on the WACK tool, as it wouldn’t find my app, and for some weird reason it wouldn’t quite work from Visual Studio either with one of the apps. So I had to do...
View ArticleLTI/ZTI PowerShell: Comment Based Help
I recommend using PowerShell comment based help to document your deployment scripts as described on Technet...Read More
View Article