SemanticVersion Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An implementation of semantic versioning (https://semver.org) that can be converted to/from Version.
When converting to Version, a PSNoteProperty is added to the instance to store the semantic version label so that it can be recovered when creating a new SemanticVersion.
public ref class SemanticVersion sealed : IComparable, IComparable<System::Management::Automation::SemanticVersion ^>, IEquatable<System::Management::Automation::SemanticVersion ^>
public sealed class SemanticVersion : IComparable, IComparable<System.Management.Automation.SemanticVersion>, IEquatable<System.Management.Automation.SemanticVersion>
type SemanticVersion = class
interface IComparable
interface IComparable<SemanticVersion>
interface IEquatable<SemanticVersion>
Public NotInheritable Class SemanticVersion
Implements IComparable, IComparable(Of SemanticVersion), IEquatable(Of SemanticVersion)
- Inheritance
-
SemanticVersion
- Implements
Semantic |
Construct a SemanticVersion. |
Semantic |
|
Semantic |
Construct a SemanticVersion. |
Semantic |
Construct a SemanticVersion. |
Semantic |
Construct a SemanticVersion. |
Semantic |
Construct a SemanticVersion from a string. |
Semantic |
Construct a SemanticVersion from a Version, copying the NoteProperty storing the label if the expected property exists. |
Build |
BuildLabel position in the SymVer string 'major.minor.patch-PreReleaseLabel+BuildLabel'. |
Major |
The major version number, never negative. |
Minor |
The minor version number, never negative. |
Patch |
The patch version, -1 if not specified. |
Pre |
PreReleaseLabel position in the SymVer string 'major.minor.patch-PreReleaseLabel+BuildLabel'. |
Compare(Semantic |
Implement Compare. |
Compare |
Implement CompareTo(Object) |
Compare |
Implement CompareTo(T). Meets SymVer 2.0 p.11 https://semver.org/ |
Equals(Object) |
Override Equals(Object) |
Equals(Semantic |
Implement Equals(T) |
Get |
Override GetHashCode() |
Parse(String) |
Parse |
To |
Implement ToString() |
Try |
Parse |
Equality(Semantic |
Overloaded == operator. |
Greater |
Overloaded > operator. |
Greater |
Overloaded >= operator. |
Implicit(Semantic |
Convert a SemanticVersion to a Version. If there is a PreReleaseLabel or/and a BuildLabel, it is added as a NoteProperty to the result so that you can round trip back to a SemanticVersion without losing the label. |
Inequality(Semantic |
Overloaded != operator. |
Less |
Overloaded < operator. |
Less |
Overloaded <= operator. |
Производ | Верзије |
---|---|
PowerShell SDK | 7.2.0, 7.3.0, 7.4.0 |