Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

How do I make a PowerShell profile if my profile path contains an apostrophe? -


i'm trying set powershell profile of machines have common profile. i'm making each machine's profile run script in dropbox can update of them easier.

i thought problem didn't know dot-source syntax well, turns out powershell doesn't path documents folder has apostrophe. full path is:

d:\owen's documents\windowspowershell\microsoft.powershell_profile.ps1 

if delete file, powershell starts fine (of course, without modifications want.) if create file, error when powershell starts up:

the string starting: @ line:1 char:75 + . 'd:\owen`'s documents\windowspowershell\microsoft.powershell_profile.ps1 <<<< ' missing terminator: '. @ line:1 char:76 + . 'd:\owen`'s documents\windowspowershell\microsoft.powershell_profile.ps1' <<<<     + categoryinfo          : parsererror: (:string) [], parentcontainserrorrecordexception     + fullyqualifiederrorid : terminatorexpectedatendofstring 

it can't fault, because script empty. deleting empty file makes go away, creating new file makes error come back. surely microsoft anticipated profile paths apostrophes?

update crud. looks old issue. maybe there's not workaround. :(

update 2 had conversation @lee_holmes on twitter this. apparently it's been fixed in super-awesome internal microsoft version, there's no hotfix available , no time table fixes since psh windows component. makes roman kuzmin's answer below appropriate answer (use 1 of global profiles), or perhaps "rename documents folder" hasn't been mentioned yet.

the similar bug reported , presumably acknowledged: powershell errors apostrophe in path

the error message different though, due different powershell version, more likely.

perhaps there no direct workaround: faulty call not under our control. if renaming of troublesome directory not option perhaps alternative location of profile can suitable solution. try put profile $pshome.

> man about_profiles ... example, windows powershell console supports following basic profile files. profiles listed in precedence order. first profile has highest precedence.   description                path -----------                ---- current user, current host $home\[my ]documents\windowspowershell\profile.ps1 current user, hosts    $home\[my ]documents\profile.ps1 users, current host    $pshome\microsoft.powershell_profile.ps1 users, hosts       $pshome\profile.ps1 ... 

the last 2 profile locations should work (unless $pshome contains problem characters, indeed).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -