Skip to content
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

Replace Convert::ToInt with explicite casting #166

Merged
merged 1 commit into from
Mar 27, 2019
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
2 changes: 1 addition & 1 deletion ConfluencePS/ConfluencePS.Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class Attachment {
public String Title { get; set; }
public String Filename { get; set; }
public String MediaType { get; set; }
public Int32 FileSize { get; set; }
public UInt64 FileSize { get; set; }
public String Comment { get; set; }
public String SpaceKey { get; set; }
public Int32 PageID { get; set; }
Expand Down
6 changes: 2 additions & 4 deletions ConfluencePS/Private/ConvertTo-Attachment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ function ConvertTo-Attachment {
$PageId = $_.container.id
}
else {
$PageID = $_._expandable.container -replace '^.*\/content\/', ''
$PageID = [convert]::ToInt32($PageID, 10)
[UInt32]$PageID = $_._expandable.container -replace '^.*\/content\/', ''
}

[ConfluencePS.Attachment](ConvertTo-Hashtable -InputObject ($object | Select-Object `
@{Name = "id"; Expression = {
$ID = $_.id -replace 'att', ''
[convert]::ToInt32($ID, 10)
[UInt32]($_.id -replace 'att', '')
}
},
status,
Expand Down