Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/Microsoft.WSMan.Management/Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,18 +734,19 @@ public interface IWSManResourceLocator
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
string ResourceUri
{
// IDL: HRESULT resourceUri ([out, retval] BSTR* ReturnValue);
// IDL: HRESULT resourceUri (BSTR value);
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1212:PropertyAccessorsMustFollowOrder", Justification = "COM interface defines put_ before get_.")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
[DispId(1)]
[return: MarshalAs(UnmanagedType.BStr)]
get;
set;

// IDL: HRESULT resourceUri (BSTR value);
// IDL: HRESULT resourceUri ([out, retval] BSTR* ReturnValue);
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
[DispId(1)]
set;
[return: MarshalAs(UnmanagedType.BStr)]
get;
}

/// <summary><para><c>AddSelector</c> method of <c>IWSManResourceLocator</c> interface. </para><para>Add selector to resource locator</para></summary>
Expand Down Expand Up @@ -818,14 +819,16 @@ string FragmentDialect

int MustUnderstandOptions
{
// IDL: HRESULT MustUnderstandOptions ([out, retval] long* ReturnValue);

[DispId(7)]
get;
// IDL: HRESULT MustUnderstandOptions (long value);

[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1212:PropertyAccessorsMustFollowOrder", Justification = "COM interface defines put_ before get_.")]
[DispId(7)]
set;

// IDL: HRESULT MustUnderstandOptions ([out, retval] long* ReturnValue);

[DispId(7)]
get;
}

/// <summary><para><c>ClearOptions</c> method of <c>IWSManResourceLocator</c> interface. </para><para>Clear all options</para></summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,37 @@ function Get-ConciseViewPositionMessage {
$highlightLine = ''
if ($useTargetObject) {
$line = $_.TargetObject.LineText.Trim()
$offsetLength = 0
$offsetInLine = 0
$startColumn = 0
if (
([System.Collections.IDictionary]$_.TargetObject).Contains('StartColumn') -and
[System.Management.Automation.LanguagePrimitives]::TryConvertTo[int]($_.TargetObject.StartColumn, [ref]$startColumn) -and
$null -ne $startColumn -and
$startColumn -gt 0 -and
$startColumn -le $line.Length
) {
$endColumn = 0
if (-not (
([System.Collections.IDictionary]$_.TargetObject).Contains('EndColumn') -and
[System.Management.Automation.LanguagePrimitives]::TryConvertTo[int]($_.TargetObject.EndColumn, [ref]$endColumn) -and
$null -ne $endColumn -and
$endColumn -gt $startColumn -and
$endColumn -le ($line.Length + 1)
)) {
$endColumn = $line.Length + 1
}
# Input is expected to be 1-based index to match the extent positioning
# but we use 0-based indexing below.
$startColumn -= 1
$endColumn -= 1
$highlightLine = "$(" " * $startColumn)$("~" * ($endColumn - $startColumn))"
$offsetLength = $endColumn - $startColumn
$offsetInLine = $startColumn
}
}
else {
$positionMessage = $myinv.PositionMessage.Split($newline)
Expand Down
Loading
Loading