PowerShell CSV script behaving strangely with different keyboard language layout

Hello all,
OK kinda stumped on this one. I have written the below simple script that takes a group and outputs its members to a CSV file. However, the script is not outputting correctly when it is run under a different keyboard layout, in this case a Norwegian
keyboard layout ("For" loop doesn't serve any purpose in this trimmed script version but was left in as this was the script that was tested):
cls
import-module ActiveDirectory
$group = "Group1"
#grabbing all of the groups properties so they can be referenced easily when needed (reduces multiple calls to AD)
[array]$members = get-adgroupmember $group
$Report = For($i=0;$i -lt $members.count;$i++){
#When processing the first member in the group, output this way
If($i -eq 0){$Table = @{`
"UserID"=$members[$i].SamAccountName;`
"Type"=$members[$i].objectclass
#When processing all other members of the group, output this way
Else{$Table = @{`
"UserID"=$members[$i].SamAccountName;`
"Type"=$members[$i].objectclass
#Create the table using the above output
New-Object psobject -Property $Table | select 'UserID','Type'
} #end of $Report and "for" loop above
#Export the table to CSV on the user's desktop
$Report | export-csv C:\Users\$env:Username\Desktop\$group.csv -NoTypeInformation
#Open the CSV file we just created
invoke-item C:\Users\$env:Username\Desktop\$group.csv
The script outputs to CSV fine for my "English" keyboard layout:
However, when the script is run on a computer with a Norwegian keyboard layout, the output is not delimited correctly:
Has anyone ever dealt with anything like this, or know why the output is not delimiting correctly? There are no errors when running the script in either English or Norwegian keyboard layout.

Ahhh... I bet you guys are exactly right!
I did a quick Google search and found this TechNet thread where jrv discusses an issue similar to mine:
http://social.technet.microsoft.com/forums/scriptcenter/en-US/4de7ed7a-f1b3-4e35-98b1-ef1f7f2ee7b2/powershell-export-from-excel-to-csv-having-delimiter
One of the links jrv gives in the article describes how to find what delimeter you're using:
http://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/
So it looks like I can just run a "(get-culture)" command in my script before I output to CSV and then use the "delimeter" parameter of export-csv. With the get-culture cmdlet, there's 2 parameters I believe I can use: the "LCID" parameter, and the "keyboardlayoutID"
parameter (but I can't seem to find a difference between the two parameters). Would you guys know which one of these parameters (LCID or keyboardlayoutID) might determine the delimiter used in CSV's? (link to LCID's below)
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

Similar Messages

  • Add-On behaves strange on different clients !

    Hi all,
    I created an add-on and tested it on a "Windows 2000 server" installed client and works perfect. It also works on a client with XP Pro Turkish SP2, .Net 1.1
    BUT it behaves strange on different clients e.g
    Client 1  (XP Pro Turkish, .Net 1.1)
    +*Add-on setup screen appears, installation ends succesfully
    *Files are copied in Sap Manage/Sap Business One/AddOns folder.+
    But
    1- The green status bar confirmation doesn't appear .
    2- Add-on isn't listed under Add-On Manager menu point.
    So I can't run the add-on anyhow, even it's configured as automatic.
    Client 2 (XP Pro English SP2, .Net 1.1)
    +*Add-on setup screen appears, installation ends succesfully
    *Files are copied in Sap Manage/Sap Business One/AddOns folder.
    *The green confirmation appears in status bar.
    *Add-on is listed under Add-On Manager menu point and I can start the add-on.+
    BUT the add-on doesn't work , I mean it doesn't do what it should normally do, e.g. add 2 submenus in main menu, etc.
    For all these add-on installations I use the same Add-On setup ard and exe files.
    Any help/tip would be greatly appreciated,

    Hello there
    We have finally succeeded in solving the Menu creation problem.
    I hope you have the same issue as we, so I will be able to help you.
    Just to make sure...
    We have developed an add-on composed of some menues and after installing it, we noticed that in some stations, the menu was not creaed, though the add-on showed that It was connected.
    Actually the problem is that the application doesnt succeed in connecting to the DI.
    our "add menu" method was called after calling to "company.connect()"
    whice was stuck during the try to connect to the company.
    thus- it never arrived to the "add menu"
    What you should do is, go to a working client:
    1. start --> ran
    2. %temp%
    you will find there a directory called: SM_OBS_DLL
    copy it, and replace it with stations that dont work.
    3. It should solve the problem.
    rgds
    Hagai

  • I was messing with my keyboard languages and i put it on a different language, then i got distracted and my iphone went on autolock and now it wont unlock. What do i do? And if i restore it will it unlock my iphone?

    I was messing with my keyboard languages and i put it on a different language then i got distracted then my iphones autolock locked my phone and now when i try to unlock my phone it doesnt have the correct letters that i have in my password so now it wont unlock. If i restore it will unlock or will i just be screwed??
    HELP ASAP!

    Yo can't. apps are locked to the account thatpurchased them and in-app purchases can only be mad with the account that originally purchased the app.
    You will have to recover use of the first account
    How do I change or recover a forgotten Apple ID Password?
    If you've forgotten your Apple ID Password or want to change it, go to My Apple ID and follow the instructions. SeeChanging your Apple ID password if you'd like more information.
    If necessary:
    Forgotten Security Questions/Answers
    You need to contact Apple by:
    1 - Use the Express lane and start here:
    https://expresslane.apple.com
    then click More Products and Services>Apple ID>Other Apple ID Topics>Forgotten Apple ID security questions.
    or
    Apple - Support -form iTunes Store - Contact Us
    2 - Call Apple in your country by getting the number from here:
    http://support.apple.com/kb/HE57
    or           
    Apple ID: Contacting Apple for help with Apple ID account security
    3 - Use your rescue email address if you set one up
    Rescue email address and how to reset Apple ID security questions
    For general  information see:
    Apple ID: All about Apple ID security questions
    If you have not uses any of the $10 you redeemed to the new account, you can likely get that refunded by contacting iTunes
    Contact iTunes

  • My Macbook Air behaves strangely with my USB devices.

    Hello! My Macbook Air behaves strangely with my USB devices. They appear in the Finder but the icon then quickly disappears, as if the device has never been connected. Sometimes the devices work fine, however. Could you please help me identify the problem?

    USB draws power from the MBA, and MBA will shut them down if too much is taken.  Try a self-powered (not USB-powered) hub, to see if the AIr acts better.  Costs about $25 at BestBuy.
    May not tbe the final solution, but no a bad idea anyway.

  • New feature request: Having the possibility to use different keyboard language on multiple monitors.

    I would love to see a new feature to allow the use of different keyboard language on multiple monitors with the same desktop mac.
    Ex.: On dual monitor desktop, use english keyboard on the left screen and french keyboard on the right screen.
    So I wouldn't have to switch keyboard language all the time!
    Thanks.

    You're not speaking to Apple here only other users like yourself.
    Your request should be directed to Apple - Mac OS X - Feedback
    regards

  • If i configure my macbook pro with arabic keyboard language options will it come with english option?

    if i configure my mac book pro with Arabic keyboard language options will it come with English option?

    Yes, if it did not have English on the keys as well you would not be able to type any email or web addresses.

  • How to get this script to work with different browser

    Do you guys know how to get this script to work with mozilla firefox? 
    do shell script "open -a safari 'https://login.binck.nl/klanten/Login.aspx?ReturnUrl=%2fklanten%2fdefault.aspx'"
    tell application "Safari"
      activate
              tell document 1
                        repeat until ((do JavaScript "location.host") is "login.binck.nl")
                                  delay 1
                        end repeat
      do JavaScript"document.getElementById('ctl00_Content_Gebruikersnaam').value='sim';document.ge tElementById('ctl00_Content_Wachtwoord').value='password';window.open(document. g etElementById('ctl00_Content_LoginButton').href, '_self', 'true');"
              end tell
    end tell
    Thank you so much in advance:)

    That isn't possible. Firefox's AppleScript dictionary doesn't contain anything which can be used to manage JavaScripts.
    (63741)

  • Automator not executing shell (bash) scripts, behaving strangely

    Hi everyone!
    I was using some Automator "programs" successfully with OS X 10.8 which did nothing more than executing shell scripts. However, after upgrading to Mavericks those workflows ceased to work. I have tried several approaches, e.g. using the shell script action or using Apple Script as a wrapper for executing a shell script. Unfortunately, I can't get it to work.
    Automator is behaving quite strangely, tough. Every approach that I tried works well as long as I'm hitting the "play" button in Automator itself. When I save the workflow as a program, either I can't execute it or or I will get strange errors (something like "Can't execute, error -1712" or so).
    I can't wrap my head around the fact that everything works fine if I execute the workflow but saved as a program it won't work. Any help would be highly appreciated.
    Regards
      Steffen

    Okay, I think I found it. There were two "hanging" automator processes, an "automator runner" and another one which name I can't remember (started with "automator" tough).
    I killed both. After that the workflows worked again.
    I still use the "execute bash in an Apple Script" solution. As this worked, I didn't try anything else (e.g. using the shell script action itself).

  • Script to SaveForWeb with different file name

    Can someone direct me to a script that can take the file and SaveForWeb in different versions and append different text to the filename?
    For example, say I've got a file called "myPhoto".  I need a script that saves it as  JPEG called "myPhotoPOWERPOINT" and a GIF called "myPhotoWEB"
    Is this possible?
    Thanks to everyone for your time

    This script will export the activeDocument as a jpg and gif
    function exportSFWJpg( doc, saveFile, qty ) {
         var exportOpts = new ExportOptionsSaveForWeb( );
         // see guide for other options
         exportOpts.format = SaveDocumentType.JPEG
         exportOpts.includeProfile = true;//default false
         exportOpts.quality = qty;
         if ( saveFile.exists ) saveFile.remove( );
         doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
    function exportSFWGif( doc, saveFile, qty ) {
         var exportOpts = new ExportOptionsSaveForWeb( );// default format is gif
         // see guide for other options
         if ( saveFile.exists ) saveFile.remove( );
         doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
    var doc = activeDocument;
    var docPath = decodeURI( doc.path );
    var docName = decodeURI ( doc.name );
    docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
    var saveName = docName[ 1 ];
    exportSFWJpg( doc, new File( docPath + '/' + saveName + 'POWERPOINT.jpg' ), 80 );
    exportSFWGif( doc, new File( docPath + '/' + saveName + 'WEB.gif' ) );

  • Order MacBook Pro with different Keyboard

    Hey Guys,
    Since i will stay in Hong Kong for some weeks, I am planning of buying me a new MacBook Pro 13-inch at the Apple Hong Kong Education Store.
    My Question:
    1) Is it possible to deliver it with a german keyboard instead of an english one? I see no adequate option during the order process. Does it cost some extra bugs?
    2) Can i use the Education Store in Hong Kong even though i am a german student with a german Certificate of Study?
    Thanks for your help.
    Cheers
    iek

    iek wrote:
    Hey Stefan,
    Big thanks for your reply.
    You're welcome anytime.
    Seems that nobody has any experience with my questions?
    It's at least a tad bit out of the ordinary and such not very usual request round here.
    Guess I have no other option than calling the Support Hotline.
    If you like keep us posted about the outcome.
    Cheers
    iek
    Good luck
    Stefan

  • IDVD behaving strangely with HDV video from FCP X and FCP 7?

    AVCHD exported from FCP X as ProRes 422 works perfectly in iDVD producing a 16:9 DVD.
    HDV doesn't, even though QT Player plays it perfectly.
    The odd thing is that 4 years ago, using legacy FCP my exported HDV videos had no problems being recognised as 16:9 by iDVD.
    So why are FCP X produced HDV videos not recognised as 16:9?
    P.S.  I know that iDVD never recognised DV in the 16:9 format but it always worked with HDV.
    Incidentally, the old trick of opening it in QT Pro and changing the frame size to 1024 x 576 does not work!
    Even stranger, I have just opened the HDV clips in FCP 7 and exported them as a QuickTime Movie.
    iDVD plays them back in the correct aspect ratio but look at the effect  .  .  .  .  muted colours and green patterns all over.
    This never happened in the past!

    I mentioned several problems so I don't know which one you are referring to. 
    After experimenting I found some workarounds.
    To cure the squashed image I created a ProRes 422 preset in Compressor 4 with a frame size of 1920 x 1080 and exported from FCP X using Compressor Presets.
    Everything now works perfectly except the encoding seems to take  longer.
    I got rid of the moire pattern when using FCP 7 by exporting as ProRes 422 1920 x 1080.

  • Finder behaves strange with MPEG2

    Has anyone experienced the following strange behavior:
    After I export a movie as an mpeg2 if i select it in the finder the explorer window disappears, the wheel curser spins, and 5 seconds later the window reappears displaying the hard drive root directory. I can get around this by selecting the icon view so i assume the problem must have something to do with apple having a problem displaying a preview of the movie.
    while this might seem like an ok work around, i once was unable to recover a file out of the trash because the first item in the trash was an mpeg2 movie. So each time i tried to open the trash the window would close after it encountered the file.

    I've had the finder cash wit mpeg-2 many times. so uh yes this is a problem.
    i

  • New Macbook pro retina but with different keyboard ?

    Can I buy the new macbook pro retina 13' in HK but with a French keyboard ? I don't find the option online.. thanks!

    No computer is fault free but Apple MBPs have a good track record.  In those cases where problems do arise, Apple has the best support in the industry.
    A MBP with 4 GB RAM with the SSD storage should be adequate for your needs.
    lsmoondancer01 wrote:
    P.s. On Apple's site I found a refurbished late 2013 model of the MacBook Pro Retina 13 with all of the same specs as listed above (4GB, not 8GB), running OS X (doesn't say which one) but for a bit less than a brand new one. Is this the same model as what they're currently selling new in their store or did they just upgrade everything to match what is being offered in the current "new" model?
    The latest MBP models came out in October 2013, so it will be the same, with the same warranty and telephone support.  The difference will be that the price will be less and it will be delivered in a plain white box.
    I have purchased three MBPs from the refurbished section.  I have never been able to detect any cosmetic differences and will go that route again.
    Ciao.

  • Outlook 2010 behaves strange with exchange 2013

    Hello,
    I imported a san certificate with a domain name for local use. This is exchange.xxxx.xx . This is also a A-record pointing to the same ip of the actual server.
    The name of the exchange server itself is mail01.xxxx.xx .
    My laptop is not a part of the domain. When i want to add my mailbox i use exchange.xxxx.xx for the server. My username can't be resolved. When i use the name of the server mail01.xxxx.xx then it works.
    I tested this with outlook 2013 and exchange.xxxx.xx could resolve my mailbox.
    So for outlook 2010 i need to use the name of the server where exchange 2013 is installed.
    For outlook 2013 i can use the alias exchange.xxxx.xx.
    Anyone has any idea ? It's not blocking. We haven't started the migration yet :p

    Hi,
    Based on my knowledge, in Exchange 2013 environment, the server name option is filled with the new type"mailbox GUID+@+ the domain portion of the user's primary SMTP address" when we configure the Exchange account in Outlook client.
    In your case, I recommned you add the following record in the host file of the computer which installs the Outlook 2010: the host name Exchange.domain.com points to your server IP address .
    Thanks,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Angela Shi
    TechNet Community Support
    Thx for your feedback. I will check this out.

  • Startup disk behaving strangely with os x

    Hi everyone,
    I've just bought this G3 power book, and it's been pretty good, but since I've upgraded the software it's been having some teething trouble...
    I've installed 10.1 on this mac (by holding down c to start up from CD), and it's worked ok, but now if I remove the power supply, the next time I start up, it tries to start up from the CD. I then either have to insert my 10.1 disc and go through the OS X installer, or insert my Mac OS 9.2 disc and change the startup disc in control panel.
    I've tried holding down the ctrl key when booting up, but no joy.
    It only started doing it when I did the software upgrade, and it only does it when the power supply has been removed.
    Anyone else had this trouble, any suggestions?

    That's superb!
    I've reset the power manager now. It's still having the same problem, but I suppose the backup battery hasn't charged fully yet.
    It seems to have made a difference to my main battery though! It just wasn't working at all before, but now the lightning bolt is on the battery icon, and one green LED lights on the barrey when i press the button.
    It's a bit odd though cos it does that for a few mins, then the plug icon appears on the battery icon, then the cross icon appears again. When I remove and replace it, it works again for a few mins. It's the same in both bays of the PBook.
    I take it it's a fault with the battery?

Maybe you are looking for

  • Why is my Apple ID not working after I've reset it, Why is my Apple ID not working after I've reset it

    Why is my Apple ID not working after I've reset it? After I change it the password icon pops up and I type the new password in and it says it's wrong? What's happening

  • How to use BAPI_INTERFACE_GETDOCU correctly?

    Folks, I need to get the list of parameters and their definitions for a specified BAPI. It appears I need to call BAPI_INTERFACE_GETDOCU to get this information. However, there is not enough information on how to call the function correctly. The foll

  • Outlook 2011 under mountain lion

    I have problem with oulook 2011 under mountain lion when I close Outlook and reopen I lose all preferences I set. For example reading pane under instead left, or download images for email ( i set yes and return to never) etc. All my preferences set b

  • APEX integration with EBS 11i10: view concurrent request output

    Hi All: ENV: APEX 4.0 EBS: 11i10 DB: 10r2 APEX is installed in the same database as EBS 11i10 1. I have developed a APEX application that is can be launched from EBS as a form function. Also, the APEX will not ask any credential when user launch it f

  • Date check validation

    Hi guys i need some assistance again with this query...it isn't working. I am not sure on if I run a sub-query (like another select statement) or need to re-write the query. What I want is to disregard the number 1300xxxxxx only for the dates between