![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Here String Problem What is wrong with this string declaration: [string] $LPTicketLink = @" <td align="center" title='' <%# ((AlertLog)Container.DataItem).Ticket =''= null='' ? "Create Ticket" :='' "Ticket Title: " + ((LPI.SCWeb.Business.AlertLog)Container.DataItem).Ticket.Title=''%>'> <%# ((AlertLog)Container.DataItem).Ticket =''= null='' ? "<a href=" + Tools.ApplicationRoot + "/TroubleTickets/NewTicket.aspx?AlertLogID=" + ((AlertLog)Container.DataItem).AlertLogID + "&Title=" + Server.UrlEncode(((AlertLog)Container.DataItem).Alert.Title) + "><Create></a>" : "<a href=" + Tools.ApplicationRoot + "/TroubleTickets/EditTicket.aspx?TicketID=" + ((LPI.SCWeb.Business.AlertLog)Container.DataItem).Ticket.TicketID + ">ID " + ((LPI.SCWeb.Business.AlertLog)Container.DataItem).Ticket.TicketID + "</a>"%> </td> "@ I've tried both the single quote and double quote version, but both give me the following error: "Encountered end of line while processing a string token." |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Here String Problem this is another powershell gotcha... one of the following works and the other doesn't $a = @" hello "@ $a = @" hello "@ whats the difference.. the space after the @" basically with here strings.. the @" has to terminate the line and the closing "@ has to start on a new line.. so invisible spaces kill |
My System Specs![]() |
| | #3 (permalink) | ||||||||||||
| Guest | Re: Here String Problem I checked for invisible spaces already. I was actually wondering at one point if the line ending style could matter (eg, CRLF vs LF) "Karl Prosser[MVP]" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) |
| Guest | Re: Here String Problem So i pasted it from your email and it works fine for me. |
My System Specs![]() |
| | #5 (permalink) | ||||||||||||
| Guest | Re: Here String Problem Ditto - Can you include it as a file? jps -- Jeffrey P. Snover[MSFT] Partner Architect, Windows Server Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Karl Prosser[MVP]" <karl@xxxxxx_o_w_e_r_s_h_e_l_l.com> wrote in message news:%23L%23b7ILKIHA.6108@xxxxxx
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Here String Problem I would, but I don't see a way to... I checked the line endings again, both in Visual Studio and in Notepad and they seem fine, no spaces after the @" or before the "@ "Jeffrey Snover[MSFT]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) |
| Guest | Re: Here String Problem are you using powershell v1, or the v2 CTP? what is your OS locale, and installed version of powershell I really have no clue, but am trying to see if we can narrow down why it doesn't work on your system but works fine on ours.. |
My System Specs![]() |
| | #8 (permalink) | ||||||||||||
| Guest | Re: Here String Problem Windows XP, English and v1.0. "Karl Prosser[MVP]" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #9 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Here String Problem Try copying + pasting it from your original message in this thread. I know you've got a local copy, but don't use that. See if that makes a difference. -- Jon "Telos" <Telos@xxxxxx> wrote in message news:1DAA6CEA-C8A9-4ABD-A282-7AFE71BA556F@xxxxxx
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #10 (permalink) | ||||||||||||
| Guest | Re: Here String Problem Correct me if I'm wrong, I can recall that in the past I couldn't write this (each line starts with TAB): $cmd = @" 'This is a temporary script to Restart a PowerShell Session 'Created $(Get-Date) On Error Resume Next Set oApp = CreateObject("Shell.Application") lnk = "%ALLUSERSPROFILE%\Start Menu\Programs\Windows PowerShell 1.0" PoSH = oShell.ExpandEnvironmentStrings(lnk) WSCript.Sleep 1000 oApp.Namespace(PoSH).ParseName("Windows PowerShell.lnk").InvokeVerb("Open") "@ Now when I run it, it's valid (v1.0). ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problems with $var | select-string -pattern $string -q | Ben Christian | PowerShell | 3 | 02-08-2008 12:41 PM |
| Re: get-eventlog search string problem | Brandon Shell [MVP] | PowerShell | 1 | 12-03-2007 05:17 PM |
| Select-String problem | Keith Hill [MVP] | PowerShell | 3 | 06-17-2007 12:18 PM |
| String PRODUCT_NAME was not found in string table | Extracampine | Vista General | 3 | 02-12-2007 06:15 AM |
| Problem Calling String(char[] value) constructor | Keith Hill [MVP] | PowerShell | 4 | 07-17-2006 07:17 PM |