Viewing 15 posts - 1 through 15 (of 64 total)
Part of a script to track SQL Server availability includes the three lines below. Checking 41 servers, inserting the results into staging tables on a separate SQL Server, de-duping those...
January 23, 2018 at 9:27 am
The first thing I noticed was $filename = "20172018"
$file= "C:\NewFolder"+$filename
That probably doesn't give you what you expect for the full file path/name. If you leave...
December 22, 2017 at 10:21 am
Remove the Mandatory=$True
Then check if servername was entered on the command line. If not use read-host to get it with your custom prompt.if (! $servername) {...
August 1, 2017 at 9:18 am
The double quotes alter $600. Either use single quotes or escape the $ sign.
"this transaction will cost `$600" -match "\$\d{3}"
December 30, 2015 at 2:27 pm
Add a path for the file. For example echo 'xxxx' > C:\temp\tempps.txt
July 15, 2014 at 11:28 am
I use the Operating system (CmdExec) type to run Powershell scripts from jobs instead of the Powershell type. For parameters in that type just add them after the script...
June 28, 2014 at 8:51 am
I've only used the WebClient class to download data, not upload. Maybe someone else will be able to answer. But reading the docs it looks like that method...
April 18, 2014 at 11:54 am
Would something like this work or do you need the hashtable?
$bound = '------=_12253dsfae4654'
Foreach ($line In Get-Content SampleData.txt) {
$test += "{0}{1}{2}`n" -F $bound, $line, $bound
}
$test
April 17, 2014 at 3:11 pm
May not be what you saw, probably not, but this should do.
$Hourly8 = 10
$Hour = 8
$Var = '$Hourly'+$Hour
$cTime = Invoke-Expression -Command "$Var"
$cTime
April 15, 2014 at 1:56 pm
Just a small change.
from if ( $item.Name -like ".sqb")
to if ( $item.Name -like "*.sqb")
and if ( $item.Name -like "*.$extension")
Also, if you want to cut...
April 8, 2014 at 12:52 pm
Try this change in the function for the SqlAdapter line.
$SqlAdapter.Fill($DataSet) | Out-Null
March 24, 2014 at 10:20 am
Get-ChildItem "D:\Solomon\Solomon IV\EventLog\DD500*.log"| Where-Object {$_.CreationTime -gt (Get-Date).Date} | Copy-Item -Destination "C:\Temp\Emailogs"
March 11, 2014 at 8:38 am
Just checked on 2 of my 2003 servers and Powershell is not on either. I thought that was the case but had to check first.
December 11, 2013 at 7:17 am
November 22, 2013 at 12:36 pm
If I understand correctly you have an array of hashes something like this.$x = @{Date ='30-Nov-12';
BillingWeek='1';
BillingMonth='DECEMBER';
Q='Q1';
Weekday='Friday';
CalendarMonth='November';
Day='30';
Year='2012';
TimeDue='8:00 AM'
}
$y = @{Date ='29-Oct-13';
BillingWeek='2';
BillingMonth='November';...
October 23, 2013 at 1:36 pm
Viewing 15 posts - 1 through 15 (of 64 total)