-
Notifications
You must be signed in to change notification settings - Fork 6k
update timespan.xml with new PWSH sample #3741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's only one file (the PowerShell example) in your PR, @doctordns. So this example won't appear anywhere in the TimeSpan documentation unless you also include TimeSpan.xml.
@@ -0,0 +1,40 @@ | |||
# <snippet1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's only one example here, do you need the snippet tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as the snippet tags - I thought these were needed to match up with the "#1" in the XML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doctordns, use snippet tags if you have multiple examples in a single file. If the example is the entire file, don't use snippet tags in the file, and don't include the snippet reference after the filename and file path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I've remove the snippet tag, removed that weird additioin to XML and I think put the snippet in the right place. Have pushed this all up and let's see what happens.
I will eventually get this all figured out at my end! ;-)
CLA was not working. Closed and reopened to get the status changed. |
@mairaw looks like the status is good now! |
@jeffwilcox yes! CLA is working again. |
Added link to new TimeSpan sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample isn't building, @doctordns. I've left a couple of comments.
@@ -2,7 +2,7 @@ | |||
<TypeSignature Language="C#" Value="public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable" /> | |||
<TypeSignature Language="ILAsm" Value=".class public sequential ansi serializable sealed beforefieldinit TimeSpan extends System.ValueType implements class System.IComparable, class System.IComparable`1<valuetype System.TimeSpan>, class System.IEquatable`1<valuetype System.TimeSpan>, class System.IFormattable" /> | |||
<TypeSignature Language="DocId" Value="T:System.TimeSpan" /> | |||
<AssemblyInfo> | |||
<AssemblyInfo>cs/structure1.cs#1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove cs/structure1.cs#1)]
.
xml/System/TimeSpan.xml
Outdated
@@ -128,7 +128,8 @@ | |||
The following example instantiates a <xref:System.TimeSpan> object that represents the difference between two dates. It then displays the <xref:System.TimeSpan> object's properties. | |||
|
|||
[!code-csharp[System.TimeSpan.Class#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.class/cs/structure1.cs#1)] | |||
[!code-vb[System.TimeSpan.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.class/vb/structure1.vb#1)] | |||
[!code-vb[System.TimeSpan.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.class/vb/structure1.vb#1)] | |||
[!code-powershell[System.Timespan.Class#1](~/samples/snippetspowershell/VS_Snippets_CLR_System/system.timespan.class/ps/structure1.ps1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path is incorrect -- it's `~/samples/snippets/powershell
Also, if you're not going to use a snippet reference, you should remove the begin snippet and end snippet tags from the PowerShell example.
[!code-powershell[System.Timespan.Class#1](~/samples/snippets/powershell/VS_Snippets_CLR_System/system.timespan.class/ps/structure1.ps1] | ||
======= | ||
[!code-powershell[System.Timespan.Class#1](~/samples/snippetspowershell/VS_Snippets_CLR_System/system.timespan.class/ps/structure1.ps1] | ||
>>>>>>> 82e294c5709be80c8c994ce2bb7d90cc02f6860d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doctordns, this is a merge conflict that GitHub wanted you to resolve; it's marked off the two variants of the text. To resolve it, you determine which version of the text is the correct one (in this case, the first is). Then delete <<<<<<< HEAD
, and delete the older variant as well as the GitHub tags:
=======
[!code-powershell[System.Timespan.Class#1](~/samples/snippetspowershell/VS_Snippets_CLR_System/system.timespan.class/ps/structure1.ps1]
>>>>>>> 82e294c5709be80c8c994ce2bb7d90cc02f6860d
@doctordns, I left a comment about resolving a merge conflict in the text. Also, in an earlier commit, you'd inadvertently added some text after an <AssemblyInfo> element; that needs to be removed, since it potentially could cause a build failure. |
I have been off ill, and now need to travel to Germany for a couple of weeks. |
I hope that you're fully recovered and have a good trip, @doctordns. |
After a couple of weeks teaching the USAF a bit about PowerShell, I'm back! And I issued a separate P/R to add this change into the documents. Just waiting for it to get approved! |
Update timespan.xml with new PWSH sample
Summary
Added a new sample
Updated timespan1.xml
Details
This is a change done off line via git.
Suggested Reviewers
If you know who should review this, use '@' to request a review.
@rpetrusha
@mairaw