Need help on my conditional logic (to switch or not to switch, that is the question)

I'm trying to write a function that will evaluate two variables, $misc1 and $misc2, they may or may not contain text. Essentially the possible outcomes are this:
1) $Misc1 is blank and $Misc2 is blank
2) $Misc1 is blank and $Misc2 has data
3) $Misc1 has data and $Misc2 is blank
4) $Misc1 has data and $Misc2 has data
if 1, return $null
if 2, return the value of $misc2 + 5 blank spaces
if 3, return the value of $misc1 + 5 blank spaces
if 4, return the value of $misc1 + 5 blank spaces + $misc2
Can I switch this, or does that only work on a single variable?
[email protected]

Thank you mdkelley, ended up with this:
Function Misc-Blank
Param
[string]$Misc1 = $Misc1,
[string]$Misc2 = $Misc2
if(([string]::IsNullOrWhiteSpace($Misc1)) -and ([string]::IsNullOrWhiteSpace($Misc2))){return,$null}
if(([string]::IsNullOrWhiteSpace($Misc1)) -and (-not [string]::IsNullOrWhiteSpace($Misc2))){return, " $misc2"}
if((-not [string]::IsNullOrWhiteSpace($Misc1)) -and ([string]::IsNullOrWhiteSpace($Misc2))){return, " $misc1"}
if((-not [string]::IsNullOrWhiteSpace($Misc1)) -and (-not [string]::IsNullOrWhiteSpace($Misc2))){return, "$misc1 $misc2"}
[email protected]

Similar Messages

  • I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    Hold down the Option key while you boot your Mac. Then, it should show you a selection of devices. Click your flash drive and it will boot from that.

  • I need help. every time i turn on my laptop an error message pops up: the procedure entry point sqlite_wao -checkpoint could not be located in the dynamic link library SQLite3.dlll  HOW DO I FIX THIS?

    i need help. every time i turn on my laptop an error message pops up: the procedure entry point sqlite_wao -checkpoint could not be located in the dynamic link library SQLite3.dlll  HOW DO I FIX THIS?

    Hi whatsthe77,
    Welcome to Apple Support Communities.
    You may want to follow the steps in this article to reinstall iTunes:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Have a great day,
    Jeremy

  • I need help syncing my contacts between Outlook and iPhone using iTunes. I followed the steps given and ended up with just email addresses showing in my contacts even though I have phone numbers and snail mail in my Outlook Contacts. Using  Windows 7

    I need help syncing my contacts between Outlook and iPhone using iTunes. I used the knowldge document and set it up to transfer my Outlook contacts to the iphone using itunes.
    In contacts on the iphone I only see the email addresses.
    Yet in Outlook I have email, snail mail and phone numbers.
    I followed the knowledge document from iphone.
    I did it once, didn't work so deleted all the contacts from the phone and tried again. Same result. I have a PC using Windows 7 64 bit.

    You can't access an Exchange account via ActiveSync with the Address Book and iCal on your Mac.
    You can access a MM account with Outlook on your PC at work and keep your MM email account server stored mailboxes synced between your PC at work, your iPhone, and the MM "cloud". Not sure about syncing MM contact info and calendar events with Outlook at the same time with an Exchange account.
    This will not provide for syncing your Exchange account contact info and calendar events with the Addresss Book and iCal on your Mac because the accounts are separate.
    You can access an Exchange account and a MM account at the same time with the iPhone's mail client, and sync contact info and calendar events over the air with both accounts at the same time. You can view combined contact info or separately for each account, and the same for calendar events.

  • Need help urgently, I upgraded my iPhone 4 with new OS 5, but at the last restore failed. Apple Customer Care helped me to resynch my phone with all that available in Library. I've got all back except my Contact no. Pls help guys, thnx

    Need help urgently, I upgraded my iPhone 4 with new OS 5, but at the last restore failed. Apple Customer Care helped me to resynch my phone with all that available in Library. I've got all back except my Contact no. Pls help guys, thnx Plz guys anyone can help plzz....I've lost all contact and I dont even have any secondary back up also...!!!

    If you've had it for less than a year, then it's still under warranty.  Take it to an Apple store or an authorized service facility.  See http://support.apple.com/kb/HT1434

  • HT5622 I need help trying to figure out why I'm not able to purchase anythi iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

    I need help trying to figure out why I'm not able to purchase anything on iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

    I need help trying to figure out why I'm not able to purchase anything on iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

  • Hey guys need help regarding iTunes U. My school is moving for iOS and Mac in the classroom and I have been appointed Junior Administrator for the schools technical department and integrating these devices into the classroom.

    Hey guys need help regarding iTunes U. My school is moving for iOS and Mac in the classroom and I have been appointed Junior Administrator for the schools technical department and integrating these devices into the classroom.
    I have an appointment with a director on Tuesday. I want to demo iTunes U. Problem is I have never used it before and have no idea how to set it up and even if I should sign up.
    Please help any ideas regarding iTunes U and how I should direct the meeting tomorrow.
    Please please post here.
    Thanks
    Tiaan

    Greetings fcit@!A,
    After reviewing your post, it sounds like you are not able to select none as your payment type. I would recommend that you read this article, it may be able to help the issue.
    Why can’t I select None when I edit my Apple ID payment information? - Apple Support
    Thanks for using Apple Support Communities.
    Take care,
    Mario

  • Leopard vs Tiger with Logic/to switch or not to switch

    That is the question. Tis nobler to stay with said tried and true tiger or switch to the inevitable new cat on the block.
    Hamlet: 1600 and something......... or was it 1500???? 1400??? AD?? BC??? I digress....

    Speaking as someone who has recently been forced to go to Leopard by buying a new Mac Pro (my G5 died), I would recommend staying on Tiger for the time being.
    I've spent two full days reinstalling and reauthorizing everything from scratch, and am now effectively dead in the water since the following products just don't work right now:
    Waves (Gold, V-series, API)
    Duende
    Access Virus TI
    Guitar Rig 2
    Garritan (Kontakt 2 player) (This plays but I can't authorize it)
    Waves just isn't supported on Leopard yet (I've read that some people have made it work; I can't). Duende doesn't work on either 4/8-core Macs or Leopard, so I'm down on two counts there. The others should allegedly work, but don't, and I have calls into tech support for all of them.
    I have read reports (here and elsewhere) of problems with the UAD-1, which is a real killer for me. I haven't installed mine yet to try it.
    That doesn't leave me with much, so I'm just sitting here waiting right now...

  • The PC that my ipod was connected crashed and i wanted to switch it to my laptop now..the question is will i lose all my pictures and notes from my ipod if i switch PC's or is there a way to make it stay since i have icloud backup on my ipod.

    hi...the pc that my ipod was connected crashed and i wanted to switch it to my laptop now..the question is will i lose all my pictures and songs from my ipod if i switch PC's or is there a way to make it stay since u have icloud backup on my ipod. i really dont want to lose my pictures so plz let me know if there is a way...thank you

    The iCloud backup does not include non-Tunes purchased music and photos that were synced to the iPod. The iCloud backup does not also included a few other things included in the iPod backup that iTunes makes.
    The iPod backup that iTunes makes does also not included non-iTunes purchases and photos synced to the iPod.
    free programs like iFunBox with copy non-iTunes purchased music and some other things from iPod to computer.  A paid program like TouchCopy is needed to copy photos synced to the iPod to a computer.

  • I have a really really big problem to my iphone icloud please help me i could send you my birth certificate for confirmation that im the real user please help me

         i have a really really big problem to my iphone icloud please help me i could send you my birth certificate for confirmation that im the real user please help me apple.corp and please tell me if this is not possible to be done it almost a month that i cant use my iphone.
         thank you for those who read this
    <Email Edited by Host>

    Remove your email address.  This is a public website, and you are addressing thousands of strangers.
    After doing that, tell us what your issue actually is.  This is a user-to-user technical forum.  You are not addressing Apple here.

  • Need help on menu list logic

    Thanks in advance!
    I need help on a menu list logic.
    There's this main menu which has 6 list buttons, and second
    list with 4 buttons.
    When I press on one button, it should load the next list.
    Problem I have here is when I click on the one button, it
    clears the previous main list buttons (which is what I want). On
    the second list, it only shows the last button, aka 4th button.
    I've attached my code here below, which is in the first
    frame.

    After posting this the solution hit me.
    I had to pass the parameter for the createButton as a "_root"
    instead of "this"

  • Need help with a currently "in-use" form we want to switch to Adobes hosting service

    Hi, I am in desperate need of help with some issues concerning several forms which we currently use a paid third party (not Adobe) to host and "re-distribute through email"...Somehow I got charged $14.95 for YOUR service, (signed up for a trial, but never used it)..and now I am paying for a year of use of the similar service which Adobe is in control of.  I might want to port my form distribution through Adobe in the hopes of reducing the errors, problems and hassles my customers are experiencing when some of them push our  "submit button". (and I guess I am familiar with these somewhat from reading what IS available in here, and I also know that, Adobe is working to alleviate some of these " submit"  issues, so let's don't start by going backwards, here) I need solutions now for my issues or I can leave it as is, If Adobe's solution will be no better for my end users...
    We used FormsCentral to code these forms and it works for the most part (if the end-user can co-operate, and thats iffy, sometimes), but I need help with how to make it go through your servers (and not the third party folks we use now), Not being cruel or racist here, but your over the phone "support techs" are about horrible & I cannot understand them or work with any of them, so I would definitely need someone who speaks English and can understand the nuances of programming these forms, to please contact me back. (Sorry, but both those attributes will be required to be able to help me, so, no "newbie-interns" or first week trainees are gonna cut it).... If you have anyone who fits the bill on those items and would be willing to help us, please contact me back at your earliest convenience. If we have to communicate here, I will do that & I can submit whatever we need to & to whoever we need to.
    I need to get this right and working for the majority of my users and on any platform and OS.
    You may certainly call me to talk about this, and I have given my number numerous times to your (expletive deleted) time wasting - recording message thingy. So, If it's not available look it up under [email protected]
    (and you will probably get right to me, unlike my and I'm sure most other folks',  "Adobe phone-in experiences")
    Thank You,
    Michael Corman
    VinylCouture
    Phenix City, Alabama  36869

    Well, thanks for writing back...just so you know...I started using Adobe products in 1987, ...yeah...back then...like Illustrator 1 & 9" B&W Macs ...John Warnock's Helvetica's....stuff like that...8.5 x 11 LaserWriters...all that good stuff...I still have some of it working on a mac...much of it was stuff I bought. some stuff I did not...I'm not a big fan of this "cloud" thing Adobe has foisted upon the creatives of the world...which I'm sure you can tell...but the functionality and usefulness of your software can not be disputed, so feel free to do whatever we will continue to pay for, ...I am very impressed with CC PS on the 64 bit PC and perhaps I will end up paying you the stipend that you demand for the other services.
    So  I guess that brings us to our problem.. a few years back and at the height of the recession and near bankruptcy myself,  I was damn lucky and hit on something and began a small arts and crafts supply service to sell my products online to a very "niche market" ...I had a unique product and still sell that product (plus others) online...My website is www.vinylcouture.com...Strange? Yes...but there is a market it seems, for everything now, and this is the market I service...Catagorically, these are 99%+ women that use these "adhesive, sticky backed vinyl products"  to make different "craft items" that are just way too various and numerous to go into... generally older women, women who are computer illiterate for the most part...and all this is irrelevant to my problem, but I want you to have every bit of background on this and especially the demographic we are dealing with, so we can get right to the meat of the problem.
    OK...So about two years ago, I decided to offer a "plain sheet" product of a plain colored "stick back" vinyl... it is available in multiple quantities of packs ( like 5 pieces, 10 pieces, 15 pieces, in a packi  & so on)...and if you are still on my site.. go to any  "GO RIGHT TO OUR ORDER PAGE"  button, scroll down a little...and then to the "PLAIN VINYL" section...you will see the Weebly website order process.) You can back out from here, I think,..but, anyway this product is available in 63 colors + or - a few. So then the problem is,  how do they select their individual colors within that (whatever) pack?... .
    So my initial idea was to enable a "selection form" for these "colors" that would be transmitted to me via email as 'part" of the "order process".. We tried getting our customers to submit a  " a list" ( something my competitiors still do, lol, poor bastards)......but that..is just unbelievable..I can't even begin to tell you what a freakin' nightmare that was...these people cannot even count to 10, much less any higher... figuring out what colors to list and send me... well, lets just say, it wasn't working......I had to figure out a better way...Something had to be done.
    So after thinking this all out,  and yeah...due to my total ignorance, i figured that we could make a form with Live Cycle Designer (Now Forms Central)...(back then something that was bundled with Adobe Acrobat Pro), I believe, and thats what this thing was authored in... and it would be all good...LOL!
    Well not so simple...as you well know, Adobe Acrobat would NOT LET YOU EMAIL anything from itself.....it just wouldn't work (and I know why, and all that hooey), but not being one to take NO for answer,.I started looking for a way to make my little gizmo work.. So I found this company that said they can "hijack" (re-direct actually) the request to email, bypass the wah-wah, and re-transmit it to the proper parties.....for less than $100 a year,  I think...its called http://pdf-fillableforms.com/.
    A nice gentleman named Joseph Silva helped us program the thing to go to his servers and back out. Please dont hassle them...I need them...for now..it basically does work...try it...you should get back a copy of the form that you filled out...good luck however,  if you're on MAC OSX or similar...
    I have included a copy of both of our forms (and feel free to fill it out and play with it)...just put test somewhere on it...(and you must include YOUR email or it will balk)..they are supposed to be mostly identical, except one seems to be twice as large....generating a 1.7 meg file upon submission, while the other one only generates a 600K file or so...thats another issue for another day or maybe you can advise on that also...
    OK so far so good......In our shop, once Grandma buys a 10 pack (or whatever), Only then she gets to the link on her receipt page ro the relevant "selection form" ,(this prevents "Filling and Sending"  with "no order" and "no payment", another early problem we had)... which they can click on and it will usually download and open up on their device if all goes well...Then our little form is supposed to be fillable and is supposed to ADD UP all the quantities, so grandma knows how many she is buying and so forth right on the fly,  and even while she changes her mind..., and IT'S LARGE so grandma can see it, and then it TOTALS it all up for them, ( cause remember, they can NOT add)..,  except there is a programming bug (mouse-click should be a mouse-up probably or something..) which makes you click in the blank spaces to get to a correct TOTAL...about 70-80% of our customers can enable all these features and usually the process completes without problems for them especially on PC's running Windows OS and Acrobat Reader X or XI...at least for most... Unfortunately it is still not the "seamless process" I would like or had envisioned for the other folks out there that do have trouble using our form....  Many folks report to us the following issues that we know of.  First of all it takes too much time to load up...We know its HUGE...is there anyway that you can see, to streamline this thing? I would love for it to be more compact...this really helps on the phones and pads as I'm sure you well know.
    Some just tell us,"it WON'T work"....I believe this is because they are totally out of it and dont even have Adobe Reader on their machine, & don't know how to get it ( yes, we provide the links).....or it's some ancient version....no one can stop this one...
    It almost always generates some kind ( at least one time)  of "error message" which we do warn them about..., telling one,  basically that "Acrobat doesnt even like this happening at all, and it could be detrimental to ones computer files", blah-blah...(this freaks grandma out really bad)...& usually they end up not even trying to send it...  and then I get calls that even you wouldn't believe...& If they DO nut up and push the Red "Submit Form" button, it will usually send the thing to us (and also back to them at the "required email address" they furnished on the form, thats what the folks at the "fillable forms place" do) so, if it's performing it's functions, why it is having to complain?. What are we doing wrong?....and how can I fix it?...Will re-compiling it or saving it as a newer version of "FormsCentral" correct any of these problems ?
    Ok, so that should keep you busy for a minute and we can start out with those problems...but the next thing is, how can I take advantage of YOUR re-direct & hosting services?, And will it get rid of the error messages, and the slowness, and the iOS incompatibilities ? (amazingly,  the last iOS Reader version worked almost OK.. but the newest version doesnt seem to work with my form on my iphone4)  If it will enable any version of the iOS to send my form correctly and more transparently, then it might be worth the money...$14.95 a MONTH you say. hmmmmm...Better be good.
    Another problem is, that I really don't need 5000 forms a month submitted. I think its like 70-100 or less....Got any plans for that?  Maybe I'm just not BIG ENOUGH to use Adobe's services, however in this case, I really don't care whose I do use as long as the product works most correctly for my customers as well as us. Like I said, If I'm doing the best I can, I won't change anything, and still use the other third party, If Adobe has a better solution, then i'm all for that as well. In the meantime, Thanks for any help you can provide on this...
    Michael Corman
    VinylCouture.com
    (706) 326-7911

  • I need Help!!! Logic won't open the automation window anymore! I press A, or click on the automation icon, but nothing!!!!

    Hello I have been Logic for a while now...I was working on a track and now the Automation Window won't open. Not even by pressing A, or clicking the Automation icon...Please help..anybody!!!!!

    Enable Auto Zoom or resize the track you'r working on, then try again.
    Cheers!

  • HELP PLEASE HELP!!! Logic Pro 7.2.3 crash-essential that I recover sog file

    Hi and advance thanks to anyone that can help with this problem.
    Right, I was working on a track on a Power Mac G5 2 X 2.3, 10.4.10, Logic Pro 7.2.3.
    I last saved the file at 3.49am and it crashed at 5.20am... It is essential that I find a more updated version than is available to me with my last save.
    Surely it must be saved in the cache somewhere?
    Why oh why does logic have a (crashed).lso feature if it so rarely works.
    I have stopped using the harddrive and have now switched Mac off until I can find a solution to this problem - so hopefully the unsaved version of the .lso file will be stored on my harddrive somewhere?
    PLEASE PLEASE PLEASE PLEASE HELP

    So, apparently you need help.
    What happened in the 2 hours between last save and crash that's so essential?
    Also, if you have 2 crashes a day, time to do some trouble shooting, if you're savvy enough, and fix your system. You know, find out what versions of the OS software and Logic7 work best with whatever audio hardware you're using.
    Kind of curious that you'd turn off your computer and just wait indefinitely for random answers than to spend some time researching issues and fixing your rig, but to each his own I guess.
    Anyway, you'll get more appropriate answer, eventually, if you offer some hardware specifics. In the meantime, here's something you could probably use to do auto-saves every few minutes:
    http://www.opuslocus.com/logic/

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

Maybe you are looking for