Stuck in the stone age and need some advice

while ($true)
$A = (Get-Date -DisplayHint time)
$log = "c:\Alert-2.csv"
Myscript | wc > c:Alert.log
Get-Content -path c:Alert.log | % { $_.Substring(1,7).Trim( ); } > c:Alert-1.log
Get-Content -path c:Alert-1.log >> c:Alert-2.csv
Add-Content >> ($(c:Alert-2.csv)) '`t,$A '
Okay I'm stock on a 2003 server that has v2 of powershell, and we are working on replacing but that's ,,,the future.
My problem is this;
I just want to append a time stamp  to each new entry in a csv file my script creates, like this
"0, 01:00:00"
I get the  "0" before the ',' but nothing after.
My results are less than optimal and I am hogtied to powershell v2 so any help would be greatly appreciated.

What do you mean by append.  A CSV is a file of comma separted values and a header.  YOu are trying to add a tab delimited filed with no header.  That won't work.
To load a CSV wew would do this:
$csv=Import-Csv $log
If you want to add and update a field we would do this:
$csv=Import-Csv $log -header h1,h2,h3...new
Where h1..hn are the existing columns and "new" is a new column name.  Now you can enumerate and assign the timestamp.
$ts=Get-Date -Display time
$csv | %{$_.New = $ts}
$csv | Export-Csv Outfile.csv -notype
¯\_(ツ)_/¯

Similar Messages

  • Having some serious issues with my iPhone and need some advice

    I'm going to these two issues which have been occuring with me for the past weeks-
    1.) I am facing a problem with my iPhone 5's lightning port or the cable. This started happening all of a sudden; one second my phone is charging, and the other it is not. Even if it is slightly moved from its position, it would stop charging, and further shaking starts it again, so on and so forth. At first I thought the issue might be with my cable, so I asked my friend to bring his lightning cable to my house so we could test that. It happened again- one shake the phone will charge, another shake stops it. (Note that any kind of movement does this, not only shaking) I'm a bit skeptical about his (my friend's) cable too, though- it shows NOT CHARGING on his iPad while it is in fact actually charging. His cable is only 3-4 weeks old though, so this confuses me even more. I think the issue might be with my port, but as of now I cannot draw a valid conclusion to my problem.
    2.) The second problem is that I've noticed my battery drains a **** lot faster now- ever since the first issue started. I manage to get my phone charging by placing it very carefully on the table and it charges overnight. However, when I pick it up in the morning, and read some news, it drains from 100% to 99% in ~60 seconds. This never happened before. Before this, it used to be at 100% for at least 10-15 minutes (might be even more). If I reboot my phone, it shows 100% again, but it still drains a lot faster now. I know because I've been using this phone for the past 4 months now, and I know when it drains and when it does nots
    Please, help! I need some advice as to how I should approach this problem. My phone is in the warranty period, however, I would like to have an expert's opinion first.

    Hello,
    First: I've experienced the same problem with my iPhone 5. I've bought a new charger and it still did the same thing. I went to the Apple Store to get my iPhone checked out and they said that the pins inside my iPhone we're damaged, and I had to get a replacement.
    ~ Josh

  • Brand new to the Mac World and NEED SOME HELP with startup disk issues

    Hello everyone. I am a new Mac user and I purchased my mac on ebay. It's an iMac that came with tiger 10.4.11. I wanted to get a fresh start on the computer, since the person who had it before me did not erase all of his stuff. I didn't know what to do so I got a startup disk/install disk off ebay also. When I go to install it says "software cannot be installed on this computer." Before I bought the software, I had called the apple store and they said it should be fine to buy any install software to put on the computer. If I could get any help it would be appreciated. I had read previous threads that I should hold down c when I start up (didn't work) or that I should select archive or erase and install (I never got these options when I went to install).

    A warm welcome to the Discussions!
    What iMac is it? I only ask as the Retail Tiger CD/DVDs don't work on IntelMacs, only PPC, (G3, G4, G5 Macs).
    Sorry what you were told by the Apple Store, but if it's a Gray CD/DVD then it is Machine specific as Neil stated.
    Sooo, what exact iMac is it, and what does it say on the CD/DVD?

  • Am going to get a new iPhone, my first and need some advice...

    Hello-
    I have been looking at getting an iPhone 4. I currently am with Verizon but both contracts (cell and data) are up so I was thinking about their iPhone 4. I have no idea if there is a difference between the way ATT deals with the calls, texts, internet and a carrier like Verizon. I am assuming the phone is the same and the OS will be the latest and the same. I did read that Verizon uses the CDMA network not the network 4GLTE. I guess when the 4G network is more of a network they might offer the option to choose.
    Does anybody know if tethering is available with any of the carriers yet or is that what either 3G or 4G should help with? If so, since 3G has been a network for sometime, and a darn good one at Verizon, what is the deal with tethering. I remember going with my friend when the iPhone first came out and ATT told them that a "concept" called tethering will be out in about a few months. I do not think after 5 years it has been out.
    I am open to all kinds of advice, cautions, suggestions, etc. as I embark on this new endeavor. being a tech nerd (in a negative way) I am nervous about how to deal with all of the functions without ruining the p[hone, which is what I usually do to the computers. I would like a super heavy duty case with a covering for the display (that allows the touch function to work). If there are choices with the iPhone 4, I would like to hear people's opinion of certain ones. Even apps. is it OK to get them on the apple website or iTunes or both? Are there apps that have been checked by Apple and are like Apple certified?
    I would like (but not sure if it is possible) to be able to travel and use the internet out in the desert, for example. I have a Verizon MiFi2200 and I use that for my MacBook and it works great. Do they have something like that for the iPhone.
    OK, that should be enough for now. OH, one more thing. Does it matter if I get applecare right of or wait until the initial warranty is about to expire before I purchase Applecare. I realize the phone sup[port will not be available to me if I wait but the genius bar and sending the camera in will be.
    Thanks a lot!

    Read here: http://support.apple.com/kb/HT2109.

  • In a world of hurt and need some advice!!

    Hi:
    I installed Boot Camp on my MacBook pro. Somehow along the way I must have trashed all the original Mac stuff on my computer. I generated the two partitions as directed with the one for Windows set for 32 gigs.
    After all sorts of ups and downs Widows works just fine. Only when I tried to start up on the Mac did I find no Mac to be had! The error message said "could not locate the Mac OS boot volume". Oh O
    No panic yet: luckily I did follow one step correctly, I put all my original contents on a "back up" external drive. So from "Boot Camp" I put the MacPro in Target mode. I thought I would just dump the entire contents in the ash can and start from scratch. With all I have learned over the last week I will be up and running in no time!
    Nope, now comes the panic! It tell me I don't have the authority to do such a thing and off the top of my head I have failed to come up with a way. There must be one!
    Help!!!
    And thanks.
    Dan Page

    Are you connecting your Mac Pro to your MBP?
    If so, it sounds to me like you're trying to throw items into the trash & Finder is throwing that error--sound right?
    The reason it's not working is this:
    even as an administrator, you don't have the right permissions to throw away another user's items (that's what the computer thinks you're trying to do, and I think that's true even if you have the same username on both machines).
    Have you tried to repair your Mac Pro's hard disc using Disk Utility on your install DVD?
    ~Lyssa

  • I am still in the stone age and using CS4.  Looking to upgrade to creative cloud.  Will I have any issues and what can I do to keep the files I have created in CS4 active with the new software?

    I want to continue to use my CS4 created projects while upgrading the Creative Cloud.  I have an Imac, Ipad, Iphone 6 and Macbook Pro.  Am I going to lose or not be able to bring those .ai files from CS4 into the new software?@

    Please refer to:
    Can You Save/Open CS6 Files on CS5, CS4 or CS3 – and Vice Versa? | ProDesignTools
    Can You Open/Use/Export/Save Adobe CC Files on CS6 – and Back? | ProDesignTools
    It has important information.
    Regards
    Rajshree

  • I am new to LR and needs some advice please

    I have been using Raw shooter and have been shy of going over to LR.I am not a hugely knowledgeable user nor that technically minded. I purchased Scott Kelbys, and Martin Evenings book on LR and am learning as I go, I have been reading several threads on this site and I am concerned about all the negativity I am reading about LR being buggy, with problems?
    and how it seems that Adobe are not doing enough with LR to address any such issues? I am a canon user and issues relating to Canon raw are a particular worry. I am about to put my entire collection from Raw shooter ( On External LAcie drives) into the hands of LR in the future. Is this a wise decision? Please help.
    Also I want to get started if it is the right thing to do, my PC is getting on abit, with 4 yr old tech inside and only 1gb ram. I will soon get somthing more powerful with 2-4 gb ram. my second question is this. I will be running my libraries on external drives only ( LAcie F.A. Porsche).
    If I have imported my images without moving folders, with LR 1.2 loaded on my pc. If later I remove LR from it and reload onto a new PC will it see all my libraries again and know all my settings again without issue and without having to re-do everything. If that is the case then I had better wait until i upgrade the Pc, before I start any work with LR, which will be frustrating.??
    Apologies for a long question, but I am technically challenged. If anyone can assist me in these areas I would be grateful
    Paul Apps

    LR is not buggy and it converts Canon RAW files just fine. I run LR on a PC without any significant issues except speed. LR is too slow in some areas (importing images, browsing thumbs and previews, in particular) compared to other programs such as Photo Mechanic and ACDSee, but it is very stable on a clean computer. Many features need improvement but hopefully that will come in time. Meantime LR is quite good and I bet you will like it. There is nothing better overall.
    You should never risk your images to any software or anything else. Keep a backup copy of your originals separate from the copy you use for LR or other software. Plus LR is a non-destructive editor (pixels are not changed) so your images will be quite safe.
    As Tomrock said you can transfer your database to a new computer without difficulty. I do recommend a new computer, a 4 year old machine with 1gb RAM will probably be frustrating. Other folks say that a quad core processor and at least 2GB RAM is the way to go. My 2 year old dual core Pentium with 4GB RAM is definitely too slow for LR. You might also consider switching to internal hard drives in your new computer and use your external drives for backups. Internal drives for your images and catalog file will be much faster.
    Also Tom's advice about importing a few images at a time and then testing how things work is very good. It is definitely a mistake to import a huge volume of images until your are familiar with LR. It is very easy to delete a small catalog file and start over since a few hundred images imports quickly.
    Good luck.

  • My dad bought an ipad 2 of my uncle for cheap since its a little broken but i tried to earse the ipad so all the password and thing from my uncle go away but i was stuck on the activation when i need an email and password but my uncle cant remember it

    My dad bought an ipad 2 of my uncle for cheap since its a little broken but i tried to earse the ipad so all the password and thing from my uncle go away but i was stuck on the activation when i need an email and password but my uncle cant remember it because he has medical problems and he does not remember the email since he has alot of emails he thinks he remembers the password since he always keep the same password. So does anyone know what i can do because the ipad is locked and my parents are like very mad at me xD

    http://support.apple.com/kb/PH13695
    Activation Lock cannot be bypassed, you will have to recover the email and password used to activate it.

  • I'm new to itunes and need some help. Can anyone tell me if it is possible to download an album which has explicit content without actually downloading the explicit songs?

    I'm new to itunes and need some help.  Can anyone tell me if it is possible to download an album which has explicit songs without actually downloading the songs that are explicit?

    See if there's a non-explicit version and download that?  Just download the individual songs you want, and not the others?
    Honestly, your phrasing doesn't make sense.  You're asking how to download an album without downloading its tracks? 

  • I need some advice about the macbook pro and iPhone 5. I took a video on my iPhone and tried to email it it said it was too big to send? So i downloaded it to my macbook pro and tried to mail it to no avail? The macbook tells me the server won't let it th

    I need some advice about the macbook pro and iPhone 5.
    I took a video on my iPhone and tried to email it it said it was too big to send? So i downloaded it to my macbook pro and tried to mail it to no avail? The macbook tells me the server won't let it through other mail goes through any ideas how to resize it or what it might take to send it?

    I agree with LowLister, the best option for you to share the video online is to upload it to your online storage account for example : Box, Dropbox, SkyDrive (All of them provide free storage beginning from 2GB).
    You can upload the files which you want to share in this online storage and then they have sharing options in which you'll will get the link of the file to be sent and send the email. You're good to go!
    Tip : You can store multiple files for backup purposes.

  • When I burn a disc from a playlist in iTunes, the track names and artist info does not display on the disc when friends view/listen to it. This probably is an easy fix, but I need some advice.

    When I burn a disc from a playlist in iTunes on my MacBook, the track names and artist info does not display on the disc when friends view/listen to it. This probably is an easy fix, but I need some advice.

    No, this standard has been implemented for several decades.
    How iTunes remembers audio CDs - http://support.apple.com/kb/TA27785
    It is just conceivable you burned a CD that exactly matched one already in the Gracenote database.  Gracenote uses track count and duration to decide what CD it is you have in a computer.  If you have one that matches that it will label it.  You could conceivably even have one that matches it that is not the correct one.
    This script will only work on Macs:
    http://dougscripts.com/itunes/scripts/ss.php?sp=cdtexttocdinfo - script to use CD-text file on CD to label CD in iTunes

  • Hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    Try a search with Google.
    Why should we do your homework for you?

  • I accidently "hide" some of my purchased apps in the app store and need to know how to make them visible again.

    I accidently "hide" some of my purchased apps in the app store and need to know how to make them visible again.

    Mac App Store- Hiding and unhiding purchases

  • I just updated my Mac Mini to latest software, tried updating GarageBand. It downloaded but now it gets stuck downloading the 'essential sounds and loops'. It always worked fine before I updated and would really appreciate some help. Thanks

    I just updated my Mac Mini to latest software, tried updating GarageBand. It downloaded but now it gets stuck downloading the 'essential sounds and loops'. It always worked fine before I updated and would really appreciate some help. Thanks

    I just updated my Mac Mini to latest software
    You mean, MacOS X 10.9.2 and GarageBand 10.0.2?
    How far does the download proceed? Do you get an error message?
    Try to resume the download as described here:  http://support.apple.com/kb/HT4485

  • My ipad is stuck on the apple logo and wont return to the home screen. I plugged it into my itunes but I don't know what to do from there. Can someone please help?

    Hi, I'm having trouble with my Ipad 2. I was recently playing a game and my ipad just shut off on me. Then when I turned it back on it was stuck on the Apple Logo and it won't go to the home screen at all. I plugged it in my itunes but I don't know what to do from there. I left it charged hoping the apple logo would dissappear but it didn't and now for some reason the battery is always dead.  I really need help. Does anybody have any suggestions? Please.

    Did you try rebooting the iPad? You will need to have some battery power for this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This may be helpful
    iPhone, iPad or iPod touch: Not responding or does not turn on
    Frozen or unresponsive iPad - Apple
    iPad: Unable to update or restore

Maybe you are looking for