powershell script to unix shell script conversion.


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers powershell script to unix shell script conversion.
# 1  
Old 04-05-2019
powershell script to unix shell script conversion.

Here is a powershell script to use restful API to create ticket in our ticketing tool. Can anyone please convert it to a shell script sothat, I can run it in Unix servers,

below is the code:
Code:
$body = @{
    Customer= ''test'
    Summary= 'test summary'
    Impact= '4-Minor/Localized'
    Urgency= '4-Low'
    Service= 'Applications'
    Incident_Type= 'User Service Restoration'
    Reported_Source= 'Direct Input'
    Assignee_Group= 'Stest'
    Product_Name= 'P_name'
    Product_Manufacturer= ‘test_product
} | ConvertTo-Json
$url = "https://test.com/"
Invoke-RestMethod -Method Post -Uri $url -UseDefaultCredentials -Body $body -ContentType 'application/json; charset=utf-8'

Moderator's Comments:
Mod Comment Please do wrap your samples/codes into CODE TAGS, as per forum rules.

Last edited by RavinderSingh13; 04-05-2019 at 12:09 PM..
# 2  
Old 04-05-2019
Hello pandeybhavesh18,

A warm welcome in the forums, on your statement.
Quote:
Can anyone please convert it to a shell script sothat, I can run it in Unix servers,
We do encourage all users to show their efforts in their post what they have put in order to solve their own problems.
So please do so, do add your efforts in your post and let us know. You will get guidance in forums but you have to show efforts.

Thanks,
R. Singh
These 2 Users Gave Thanks to RavinderSingh13 For This Post:
# 3  
Old 04-05-2019
Please choose a meaningful title for your thread. "Help with shell script" doesn't really convey any info on your request!
I changed it for you, this time.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script ouput conversion

Hi All, I am trying to print all the packages info in solaris 11 using below script. #!/usr/bin/env bash pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' > /tmp/cp1 /usr/bin/nawk -F: ' {for (i=1; i<=NF; i++) {gsub (/^ *| *$/, "", $i) ... (5 Replies)
Discussion started by: sravani25
5 Replies

2. Shell Programming and Scripting

Execute powershell script with UNIX

Hi I have a powershell script which is checking whether a windows service is running (as shown below) function FuncCheckService { $ServiceName = 'pgsql-9.2' $arrService = Get-Service -Name $ServiceName if ($arrService.Status -eq 'Running') { Write-Output... (8 Replies)
Discussion started by: simpsa27
8 Replies

3. Shell Programming and Scripting

Batch to shell script conversion

Hi All, I have a small tool which is currently configured in batch scripts only. But my need is to run it on Linux platform, so I have been trying to convert a batch script to shell script. below is the batch script: @echo off IF "%1"== "" GOTO ARGERR REM UPDATE THESE PROPERTIES TO... (2 Replies)
Discussion started by: sukhdip
2 Replies

4. Shell Programming and Scripting

Conversion of Perl Script to Shell Script..

Hi Guys I am having a perl script that fetches exclude list from a unix client and I trying it to convert it to shell script but I am having issues please help me... #!/usr/bin/perl use strict; use warnings; use Getopt::Std; # To turn on debuging (i.e. more information) specify... (29 Replies)
Discussion started by: Pawan Ramnani
29 Replies

5. Shell Programming and Scripting

Conversion batch shell script

while converting batch file to shell script ...dis command is ther i dunno how to change...can anyone knws how to change into shell script rm !(D:\temp\XX.txt) (3 Replies)
Discussion started by: monisha
3 Replies

6. Shell Programming and Scripting

Shell script for CSV conversion

thanks for allowing me join your forum i have an output of linux command "who" which provides following details..... CURRENT USER/ACCT INFO 17:31:36 up 4:49, 4 users, load average: 0.03, 0.04, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root :0 - 12:59 ?xdm? 4:54 0.02s /bin/sh /usr/bi... (1 Reply)
Discussion started by: ayyappancheta
1 Replies

7. AIX

Need timestamp conversion shell script !!

Can anyone provide me with a ksh or bash script which will accept a timestamp (format is YYYY-MM-DD-HH24.Mi.Ss) and time offset (in hours). The output will be (timestamp passed - time offset passed deducted from it) in the same YYYY-MM-DD-HH24.Mi.Ss format. Basically I am trying to convert the... (1 Reply)
Discussion started by: shibajighosh
1 Replies

8. Shell Programming and Scripting

Help me with file conversion [Shell Script]

Hello Group, I request your help with a shell script for filter an ascii file (this is small piece of the file): 09/24/2009,00:00,1.0268,1.0268,1.0249,1.0250,518 09/24/2009,01:00,1.0251,1.0261,1.0249,1.0259,424 09/24/2009,02:00,1.0258,1.0272,1.0258,1.0269,372... (3 Replies)
Discussion started by: csierra
3 Replies

9. Windows & DOS: Issues & Discussions

unix script and unix2dos conversion

Hi, I am a newbie and do not have much experience using unix. But I have been trying to understand it. I found the following unix script typeset -i n=0 while do sleep 5 echo "${n}:Fluent is running...." n=${n}+1 done I have the following doubts: 1) In the first line - I am aware... (1 Reply)
Discussion started by: karthiksrao
1 Replies

10. Shell Programming and Scripting

shell script conversion to binary

My question is: i have a script called getevent to run i just call ./getevent can i convert this to make it binary executable and not letting my clients open it and see the code.??:( I am using Solaris 8. (3 Replies)
Discussion started by: bcheaib
3 Replies
Login or Register to Ask a Question