Skip to content

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

Closed
wants to merge 7 commits into from
Closed

update timespan.xml with new PWSH sample #3741

wants to merge 7 commits into from

Conversation

doctordns
Copy link
Contributor

@doctordns doctordns commented Nov 19, 2017

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

Copy link
Contributor

@rpetrusha rpetrusha left a 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>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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! ;-)

@mairaw mairaw closed this Nov 20, 2017
@mairaw mairaw reopened this Nov 20, 2017
@mairaw
Copy link
Contributor

mairaw commented Nov 20, 2017

CLA was not working. Closed and reopened to get the status changed.

@jeffwilcox
Copy link

@mairaw looks like the status is good now!

@mairaw
Copy link
Contributor

mairaw commented Nov 20, 2017

@jeffwilcox yes! CLA is working again.

Added link to new TimeSpan sample
Copy link
Contributor

@rpetrusha rpetrusha left a 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&lt;TimeSpan&gt;, IEquatable&lt;TimeSpan&gt;, IFormattable" />
<TypeSignature Language="ILAsm" Value=".class public sequential ansi serializable sealed beforefieldinit TimeSpan extends System.ValueType implements class System.IComparable, class System.IComparable`1&lt;valuetype System.TimeSpan&gt;, class System.IEquatable`1&lt;valuetype System.TimeSpan&gt;, class System.IFormattable" />
<TypeSignature Language="DocId" Value="T:System.TimeSpan" />
<AssemblyInfo>
<AssemblyInfo>cs/structure1.cs#1)]
Copy link
Contributor

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)].

@@ -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]
Copy link
Contributor

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
Copy link
Contributor

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 

@rpetrusha
Copy link
Contributor

@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.

@doctordns
Copy link
Contributor Author

I have been off ill, and now need to travel to Germany for a couple of weeks.
This PR is in a bit of a messy state (my own mistakes, I'm afraid). So I'm closing it, and when I get back to the UK I'll try again.

@doctordns doctordns closed this Nov 25, 2017
@rpetrusha
Copy link
Contributor

I hope that you're fully recovered and have a good trip, @doctordns.

@doctordns
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants