How to I run a chain of command that has too many escape characters and others

Hello

I know that this is not a forum of PowerShell, but maybe this will eventually help someone else!

I need to run the command following, just that one single line:

curl - vvvv - XPUT - negotiate u: - insecurity - XPUT g h ' "Content-Type: application/json" "d '{\"hosttype\":\"server\', \"address\': [\"127. "

"" "" "" "" [" 0.0.1\"], \"parents\": [], \"tag\ ': [\"demo\'], \"umiworker\": \"gent\", \"notes\": \"this is a test\ ', \"url\ ':------"http://www.tomtom.com------"} " https://someservert/v1/host/test "

However, no matter how many times I put a variable for it, it still does not work.

Can someone help me wrap this thing and run it in PS?

Thank you!

Hello

I had found this triple citing worked, but not for the media. Therefore, I used the Convertto-JSON with quotes to give me the correct output. I does only once because I use the string over and over again using variables instead of some mandatory parameters. NOTE: one line, runs the command that results from what is needed.

« $json = "" "content-Type: application/json" "d" "{'" hosttype' ': '' server' ', '' address' ': ["' 127.0.0.1'"], "' parents'": [], '' tag' ': "' demo'"], '' umiworker' ': '' gent' ', '' notes' ': "' this is a test'", "' url'": ""http://www.tomtom.com"" ""} https://someservert/v1/host/test' | "» ConvertTo-JSON

$json contains the following:

"[" "\"\"Content-Type: application/json\"------"\"\"{\"\"hosttype\"\":\"\"server\"\",\"\"address\"\ d ': [\"\"127.0.0.1\"\" "], \"\"parents\"\ ": [], \"\"tag\"\ ': \"\"demo\"\ ']------,

"{\"umiworker\"\ ': \"\"gent\"\ ', \"\"notes\"\ ': \"\"this is a test\"------", \"\"url\"\ ":------"------"http://www.tomtom.com------"------"} https://someservert/v1/host/test"

Then I put the parameters of command/set. I realize, I could use the $json variable here, maybe, but for me there is no need.

"$cmd = @".

"[' curl.exe - XPUT - H" \"\"Content-Type: application/json\ "------" \"\"{\"\"hosttype\"\":\"\"server\"\",\"\"address\"\ d ': [\"\"127.0.0.1\"\ ""], \"\"parents\"\": [], \"\"tag\"\ ': \"\"demo\"\ ']------,

"{\"umiworker\"\ ': \"\"gent\"\ ', \"\"notes\"\ ': \"\"this is a test\"------", \"\"url\"\ ":------"------"http://www.tomtom.com------"------"} https://someservert/v1/host/test"

"@

Hope this helps someone else!

Tags: VMware

Similar Questions

  • I can't install antivirus avast because the registry has too many temporary files and virus and spyware or malicious software. How can I fix it, manually or software?

    Computer is a 12, xps dell dimension 8800.Tried using disk cleanup and Defrag on the computer, but it could not remove a large number of temporary files. Still can not re - install the avast antivirus that was installed previously, done updates also.

    I suggest before you do anything. Type MSCONFIG in run in the start menu. Click the Startup tab, and then tap off everything. Restart the computer.

    You can clean your temporary files and other unnecessary files with CCleaner.
    http://www.Piriform.com/ccleaner/download

    If request you something to keep on the first run saved passwords from your browser then press no. On the first screen, click on run cleaner on the bottom right.

    If you believe in the detectability of Avast, you can try to install again. Or you can download and install the virus Kaspersky 2011 removal tool.

    http://www.Kaspersky.com/antivirus-removal-tool?form=1

    And spyware, you can install Spybot Search and destroy.

    http://www.safer-networking.org/en/mirrors/index.html

    Note: Make sure that you run the update of the tools.

    Note #2: Virus removal tool is only intended to get rid of the virus. It is not supposed to be used as an anti-virus official.

  • How can I run my validations after confirming that a specific field is not NULL?

    Hello

    How can I run my validations after confirming that a specific field is not NULL?

    One of my validation needs to ensure that a specific page element is not NULL, then I use the option 'required value' of the page element, but it seems that the validation is performed before the option "required value.

    I know I could create 2 different validations for each case, but I think it would be nicer if I could work through the only validation and leave the APEX to manage the field validation is NOT NULL

    Best regards and thanks for reading

    According to my experience, it appears that the APEX is going through all THE postings...

    IE, if a "failure" of Validation continues.

    It's actually beneficial for the end user, because it will get ALL the errors in the form he or she made... not just a first.

    workaround solution:

    1. Remove the 'required' on the element value (.. but keep the "required" model)
    2. Add the NOT NULL check to your personal validation process.

    Very probably, the 2nd one will be in a PL/SQL function return error text.

    MK

  • How to find the url of adf application that has been deployed to the glassfish Server? I try but? It is the image of the page.

    Mr President

    This is the page of the glassfish Server

    gfurl.png

    How to find the url of adf application that has been deployed to the glassfish Server? I try but? It is the image of the page.

    webapplink.png

    In the jdev web module are

    [11: 09:38] wrote the Web for F:\backup of AshCMS\AshCMS\ViewController\deploy\AshCMS_ViewController_webapp.war application Module

    [11: 10:33] wrote the Module Enterprise Application to F:\backup of AshCMS\AshCMS\deploy\AshCMS_Project1_AshCMS.ear

    [11: 10:33] Application deployment...

    [11: 14:24] Application deployed successfully.

    [11: 14:24] time to deployment: 8 minutes, 11 seconds

    [11: 14:24]-deployment is complete.  ----

    what url in the browser.

    Concerning

    Mr President.

    I run my application on built-in web logic server and get the url from there

    http://localhost:7101 / ViewController/faces/MainPage

    then simply change the localhost of 7101 to 8081 as below

    http://localhost: 8081, ViewController, faces, MainPage

    and it works

    Concerning

  • How to locate the owner of an iPhone that has been reported lost and deleted?

    How to locate the owner of an iPhone that has been reported lost and deleted?

    You return to the police or to the carrier the phone is bound to and let them deal with him. Privacy laws prevent Apple, or the carrier to disclose this information.

  • How long should you wait after badly answering security questions too many times in a row

    How long should you wait after badly answering security questions too many times in a row

    How long should you wait for what? If you have temporarily disabled your account screen should say how long you have to wait until you can try again. If you mean for the reset link show on your account then does not appear if you have an e-mail address of verified relief on your account, if you have not you don't you must follow the section "If you can not reset your security questions" at the bottom of the page you have posted since

  • How to get back the original format of e-mail? Is there a choice? I feel that outlook has too many restrictions!

    How to get back the original hotmail format? Is there a choice? I feel that outlook has too many restrictions. For example, I have to send an e-mail during the... For some reason, Outlook does not allow me to.

    Unfortunately, if you were auto update, there is no option to return back.  Microsoft upgrades everyone to Outlook.com in the coming weeks

    http://Windows.Microsoft.com/en-us/Windows/Outlook/auto-upgrade-Outlook-FAQ
    If you have specific questions, we would be happy to help but Outlook.com is here to stay.
  • How to save a copy of Windows XP that has been created by an image?

    I used 'Image for Linux' to create an image of a PC with Windows XP, SP3.  With that done, I can copy the image to a new PC and it works fine (assuming that I stay within the limits of the PC HAL).

    My problem is that I don't have to enter a new key of Windows XP when I installed the image on another PC. for example, I use a license of Windows XP on two PCs.  Since I want to be legitimate on my software license, I tried to activate Windows XP license to new PC - but the computer says that the license is already activated.  So it is logical that the new PC would react like that - I put the picture of an activated copy of Windows on a new PC, the new copy of Windows must also think that it is enabled.

    All this brings me to my original question: how to save a copy of Windows XP that has been created by an image?

    Hi RichardMatt,
     
    I recommend you contact the customer service of Microsoft for queries on activation for clarity.
     
    See the following article to do the same thing:
  • I have Windows Vista - I'm a msge saying that the recovery disc (D) is almost full. How can I transer to OS (C) Disk that has plenty of room to the left?

    I have Windows Vista.  I'm a msge saying that the recovery disc (D) is almost full.

    How can I transfer to OS (C) Disk that has plenty of room?    Thank you.

    Hello

    I'm sorry, but you cannot move the D: Partition recovery or its contents; It will not work if you do.

    Your recovery Partition was photographed on your hard drive during the production of your computer by the manufacturer for all of these reasons.

    1. If you want to reinstall Windows from in the case of a failure of the system, based on individuals or the keys at startup.

    F10 or Alt + F10 or F11 are a couple of different manufacturers use sequences.

    You will need to ask your manufacturer for proper sequence.

    2. to make the recovery disks on if your drive hard breaks down, so that you can then reinstall the operating system on a new hard drive.

    Also ask them how to make records.

    Your D: Recovery Drive is should not be used for backups, defragmented, etc..

    There are backups on an external hard drive.

    To resolve the problems that have arisen with the recovery D: Partition, you will need to contact the manufacturer of your computer to remove all that has been added to it.

    See you soon.

  • How to enable bitlocker 'again' on a drive that has already been decrypted BitLocker... ??? Help, please!...

    How to enable bitlocker 'again' on a drive that has already been decrypted BitLocker... ??? Help, please!...

    Hi Julie,.

    I'll be happy to help you with the problem you have with the computer. I understand the frustration when things do not work as it should.

    To activate the BiLocker:

    1. Open the BitLocker Drive encryption by hitting on any fly in the right edge of the screen, quilting search (or if you use a mouse, pointing to the top right of the screen, move the pointer of the mouse down and then clicking search), registering BitLocker in the search box, type, or by clicking on settings and then by typing or clicking on BitLocker Drive encryption.
    2. Press or click enable BitLocker. You may be prompted for an administrator password or to confirm your choice.

      The configuration of BitLocker Drive Encryption dialog box opens.

    3. Follow the instructions.

    You can follow the article below to learn more about BitLocker.

    http://Windows.Microsoft.com/en-us/Windows/protect-files-BitLocker-Drive-Encryption#1TC=Windows-8

    Hope this information is useful. Please report if you have any other questions. I'll be happy to help you.

    Thank you.

  • Is there a command that will take a nested sequence and break in it is separated from the pieces, as they were before, he become nested?

    Is there a command that will take a nested sequence and break in it is separated from the pieces, as they were before, he become nested? I think I've seen this once iin training but I don't remember and can't find it.

    I have roughly the same open close and music track for 4 shows and I hate having to create these same elements to see all four the separately.

    Thank you

    Steve

    You must click the icon before you glue the nest in a new sequence.

  • I had photoshop elements 13 on another computer that has been recovered by Microsoft and replaced by the new. How can I remove the serial number of a computer that no longer exists?

    I had photoshop elements 13 on another computer that has been recovered by Microsoft and replaced by the new. How can I remove the serial number of a computer that no longer exists?

    You are allowed to activate the software on two computers. If this is your second installation on the new machine, the software should assign without problem.

  • How can I change my initial e-mail that I do not have access, and I need to check during installation?

    How can I change my initial e-mail that I do not have access, and I need to check during installation? Installer use my ID Adobe but an old address...

    Thanks in advance

    Sign out of Adobe Creative Cloud app and sign and select.

    Impossible to disconnect or no logout option?

    See the link below:

    The previous user didn't verify his account. I don't know how to close the session?

  • How can I recover data from a disk that has been done under windows xp with the new computer that is running windows 7?

    My drive has been created using a windows xp windows live care and my new computer works with windows 7. How can I get information on the new computer. When I tried to download the software of microsoft it would allow me to do. Any ideas?

    Hi Dorene33,

    ·         What exactly happens when you try to download the software?

    ·         You receive an error message?

    ·         You are able to access drive from devices and printers?

    ·         What happens exactly when you double click on the drive and try to open it?

    I suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malware

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: While running scan on the hard drive if bad sectors are found on the hard drive when scanning try to repair this area if all available on which data may be lost.

    Hope this information helps.

  • How to remove the best malware protection virus that has infected my system Vista?

    Hello, yesterday while I was doing a search, best protection malware infected my system. I scanned my PC with microsoft security databases, but the shortcuts exist on my computer. What should I do? Has it damaged my files?

    Hello

    Download update and scan with the free version of malwarebytes anti-malware

    http://www.Malwarebytes.org/MBAM.php

    You should also download and run rkill to stop the process of problem before you download and scan with malwarebytes

    http://www.bleepingcomputer.com/download/anti-virus/rkill

    If it does not remove the problem and or work correctly in normal mode do work above in safe mode with networking

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode with networking with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.

    after it is deleted:

    also run the sfc/scannow command.

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms,Accessories, right-clickguest, and then clickrun as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions

    If SFC detects the main problems it can't fix you may need to borrow a Microsoft dvd vista not an acer, HP etc. recovery disk and do a repair installation

    read the below tutorial on how to perform a repair installation

    http://www.Vistax64.com/tutorials/88236-repair-install-Vista.html

Maybe you are looking for

  • Lock screen

    It appeared this afternoon.  Can someone tell me where it comes from and how get rid of?

  • Delete a search engine

    I hate to be the search engine by default first in my list of Yahoo. Go in "subject: config" and change the default engine it is only temporary, as he returned to Yahoo after a full installation of Firefox. I tried to go to the Firefox program folder

  • Menu popup toolbar disappears immediately after moving the mouse.

    Can I call context menu on toolbars, but now when I move the mouse to select an item listed, the menu disappears, preventing me from making a selection. Yes, I have search and yes I found a lot of topics with the same problem. None of them have any s

  • The system cannot find the specified file

    Encounter this error when installing my application on another pc (win xp). Works ok on my pc (win7, LabVIEW2013 SP1) to develop. There is no error code, or the name of the file. Someone at - he had this error before? The installation program does no

  • How to repair a file missing grconv.dll

    Have a missing GRCONV. Message DLL file when installing Motorola phone software. How to get this file. ?