How do i get the message body from an servicebus message in powershell?How to run a PowerShell scriptHow to handle command-line arguments in PowerShellHow do I pass multiple parameters into a function in PowerShell?How to pass an argument to a PowerShell script?How do you comment out code in PowerShell?How do I concatenate strings and variables in PowerShell?.Net Core Serialize an Object with IEnumerables<T> to Save as XMLAzure Functions Service Bus Trigger: getting Serialization exception when trying to bind to custom classInvoking callbacks from PowerShell functionsAzure ServiceBus Message Serialization/Deserialization
Company requiring me to let them review research from before I was hired
Considerations when providing money to one child now, and the other later?
How could an engineer advance human civilization by time traveling to the past?
Sci-fi short story: plants attracting spaceship and using them as a agents of pollination between two planets
What's the explanation for this joke about a three-legged dog that walks into a bar?
Are gangsters hired to attack people at a train station classified as a terrorist attack?
What's the 1 inch size square knob sticking out of wall?
Why do people say "I am broke" instead of "I am broken"?
When were "acrobatics" introduced at weddings?
Are glider winch launches rarer in the USA than in the rest of the world? Why?
How to repair basic cable/wire issue for household appliances
How can I make sure my players' decisions have consequences?
Is the apartment I want to rent a scam?
Extrapolation v. Interpolation
Why did computer video outputs go from digital to analog, then back to digital?
Historicity doubted by Romans
Short story where a flexible reality hardens to an unchanging one
Using paddles to support a bug net
Where is this photo of a group of hikers taken? Is it really in the Ural?
Is it possible to eat quietly in Minecraft?
Impact of throwing away fruit waste on a peak > 3200 m above a glacier
What is an Eternal Word™?
ExactlyOne extension method
Why did NASA use Imperial units?
How do i get the message body from an servicebus message in powershell?
How to run a PowerShell scriptHow to handle command-line arguments in PowerShellHow do I pass multiple parameters into a function in PowerShell?How to pass an argument to a PowerShell script?How do you comment out code in PowerShell?How do I concatenate strings and variables in PowerShell?.Net Core Serialize an Object with IEnumerables<T> to Save as XMLAzure Functions Service Bus Trigger: getting Serialization exception when trying to bind to custom classInvoking callbacks from PowerShell functionsAzure ServiceBus Message Serialization/Deserialization
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to learn about some PowerShell and dotnet so I'm using some code I found.
I'm trying to grab some messages off my service bus using PowerShell and I'm able to send to the queue, but I'm a bit lost on receiving them.
I'm able to get the ID of the message but I'm having trouble getting the body.
The code I attached with the post is giving me the following exception.
"calling "Invoke" with "2" argument(s): "Expecting element 'string'
from namespace'http://schemas.microsoft.com/2003/10/Serialization/'..
Encountered 'Element' with name 'FileInfo', namespace
'http://schemas.datacontract.org/2004 /07/System.IO'. "
Is this the correct way to go about doing this if it has to be PowerShell?
I've looked into the Microsoft documentation for the datacontractserializer (which i think is the way go?), but I'm unsure on the formatting in converting it from dotnet to PowerShell
$BindingFlags= [Reflection.BindingFlags] "Public,Instance"
$generic_method = $message.GetType().GetMethod("GetBody",$BindingFlags,$null, @(),$null).MakeGenericMethod([String]).Invoke($message,$null)
azure powershell .net-core azureservicebus
add a comment |
I'm trying to learn about some PowerShell and dotnet so I'm using some code I found.
I'm trying to grab some messages off my service bus using PowerShell and I'm able to send to the queue, but I'm a bit lost on receiving them.
I'm able to get the ID of the message but I'm having trouble getting the body.
The code I attached with the post is giving me the following exception.
"calling "Invoke" with "2" argument(s): "Expecting element 'string'
from namespace'http://schemas.microsoft.com/2003/10/Serialization/'..
Encountered 'Element' with name 'FileInfo', namespace
'http://schemas.datacontract.org/2004 /07/System.IO'. "
Is this the correct way to go about doing this if it has to be PowerShell?
I've looked into the Microsoft documentation for the datacontractserializer (which i think is the way go?), but I'm unsure on the formatting in converting it from dotnet to PowerShell
$BindingFlags= [Reflection.BindingFlags] "Public,Instance"
$generic_method = $message.GetType().GetMethod("GetBody",$BindingFlags,$null, @(),$null).MakeGenericMethod([String]).Invoke($message,$null)
azure powershell .net-core azureservicebus
add a comment |
I'm trying to learn about some PowerShell and dotnet so I'm using some code I found.
I'm trying to grab some messages off my service bus using PowerShell and I'm able to send to the queue, but I'm a bit lost on receiving them.
I'm able to get the ID of the message but I'm having trouble getting the body.
The code I attached with the post is giving me the following exception.
"calling "Invoke" with "2" argument(s): "Expecting element 'string'
from namespace'http://schemas.microsoft.com/2003/10/Serialization/'..
Encountered 'Element' with name 'FileInfo', namespace
'http://schemas.datacontract.org/2004 /07/System.IO'. "
Is this the correct way to go about doing this if it has to be PowerShell?
I've looked into the Microsoft documentation for the datacontractserializer (which i think is the way go?), but I'm unsure on the formatting in converting it from dotnet to PowerShell
$BindingFlags= [Reflection.BindingFlags] "Public,Instance"
$generic_method = $message.GetType().GetMethod("GetBody",$BindingFlags,$null, @(),$null).MakeGenericMethod([String]).Invoke($message,$null)
azure powershell .net-core azureservicebus
I'm trying to learn about some PowerShell and dotnet so I'm using some code I found.
I'm trying to grab some messages off my service bus using PowerShell and I'm able to send to the queue, but I'm a bit lost on receiving them.
I'm able to get the ID of the message but I'm having trouble getting the body.
The code I attached with the post is giving me the following exception.
"calling "Invoke" with "2" argument(s): "Expecting element 'string'
from namespace'http://schemas.microsoft.com/2003/10/Serialization/'..
Encountered 'Element' with name 'FileInfo', namespace
'http://schemas.datacontract.org/2004 /07/System.IO'. "
Is this the correct way to go about doing this if it has to be PowerShell?
I've looked into the Microsoft documentation for the datacontractserializer (which i think is the way go?), but I'm unsure on the formatting in converting it from dotnet to PowerShell
$BindingFlags= [Reflection.BindingFlags] "Public,Instance"
$generic_method = $message.GetType().GetMethod("GetBody",$BindingFlags,$null, @(),$null).MakeGenericMethod([String]).Invoke($message,$null)
azure powershell .net-core azureservicebus
azure powershell .net-core azureservicebus
edited Mar 26 at 21:07
AdminOfThings
5,6952 gold badges2 silver badges14 bronze badges
5,6952 gold badges2 silver badges14 bronze badges
asked Mar 26 at 15:16
Mathias WrobelMathias Wrobel
134 bronze badges
134 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Download and try this example to learn from …
biz.dfch.PS.Azure.ServiceBus.Client 1.0.2.20160609
function Get-MessageBody
<#
.SYNOPSIS
Get the message body from a Service Bus Message.
.DESCRIPTION
Get the message body from a Service Bus Message.
.OUTPUTS
This Cmdlet returns the Body as [String] from the MessageFactory Message object. On failure it returns $null.
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Get the message body from a Service Bus Message.
PS > Get-Message # function
if($MyInvocation.ScriptName) Export-ModuleMember -Function Get-MessageBody;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360606%2fhow-do-i-get-the-message-body-from-an-servicebus-message-in-powershell%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Download and try this example to learn from …
biz.dfch.PS.Azure.ServiceBus.Client 1.0.2.20160609
function Get-MessageBody
<#
.SYNOPSIS
Get the message body from a Service Bus Message.
.DESCRIPTION
Get the message body from a Service Bus Message.
.OUTPUTS
This Cmdlet returns the Body as [String] from the MessageFactory Message object. On failure it returns $null.
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Get the message body from a Service Bus Message.
PS > Get-Message # function
if($MyInvocation.ScriptName) Export-ModuleMember -Function Get-MessageBody;
add a comment |
Download and try this example to learn from …
biz.dfch.PS.Azure.ServiceBus.Client 1.0.2.20160609
function Get-MessageBody
<#
.SYNOPSIS
Get the message body from a Service Bus Message.
.DESCRIPTION
Get the message body from a Service Bus Message.
.OUTPUTS
This Cmdlet returns the Body as [String] from the MessageFactory Message object. On failure it returns $null.
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Get the message body from a Service Bus Message.
PS > Get-Message # function
if($MyInvocation.ScriptName) Export-ModuleMember -Function Get-MessageBody;
add a comment |
Download and try this example to learn from …
biz.dfch.PS.Azure.ServiceBus.Client 1.0.2.20160609
function Get-MessageBody
<#
.SYNOPSIS
Get the message body from a Service Bus Message.
.DESCRIPTION
Get the message body from a Service Bus Message.
.OUTPUTS
This Cmdlet returns the Body as [String] from the MessageFactory Message object. On failure it returns $null.
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Get the message body from a Service Bus Message.
PS > Get-Message # function
if($MyInvocation.ScriptName) Export-ModuleMember -Function Get-MessageBody;
Download and try this example to learn from …
biz.dfch.PS.Azure.ServiceBus.Client 1.0.2.20160609
function Get-MessageBody
<#
.SYNOPSIS
Get the message body from a Service Bus Message.
.DESCRIPTION
Get the message body from a Service Bus Message.
.OUTPUTS
This Cmdlet returns the Body as [String] from the MessageFactory Message object. On failure it returns $null.
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Get the message body from a Service Bus Message.
PS > Get-Message # function
if($MyInvocation.ScriptName) Export-ModuleMember -Function Get-MessageBody;
answered Mar 27 at 0:45
postanotepostanote
4,9982 gold badges4 silver badges11 bronze badges
4,9982 gold badges4 silver badges11 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360606%2fhow-do-i-get-the-message-body-from-an-servicebus-message-in-powershell%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown