forked from d365collaborative/d365fo.tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request d365collaborative#3 from d365collaborative/develop…
…ment sync
- Loading branch information
Showing
6 changed files
with
145 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
<# | ||
.SYNOPSIS | ||
Get the file version details | ||
.DESCRIPTION | ||
Get the file version details for any given file | ||
.PARAMETER Path | ||
Path to the file that you want to extract the file version details from | ||
.EXAMPLE | ||
PS C:\> Get-FileVersion -Path "C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin\AxServ32.exe" | ||
This will get the file version details for the AX AOS executable (AxServ32.exe). | ||
.NOTES | ||
Author: Mötz Jensen (@Splaxi) | ||
Inspired by https://blogs.technet.microsoft.com/askpfeplat/2014/12/07/how-to-correctly-check-file-versions-with-powershell/ | ||
#> | ||
function Get-FileVersion { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string] $Path | ||
) | ||
|
||
if (-not (Test-PathExists -Path $Path -Type Leaf)) { return } | ||
|
||
Write-PSFMessage -Level Verbose -Message "Extracting the file properties for: $Path" -Target $Path | ||
|
||
$Filepath = Get-Item -Path $Path | ||
|
||
[PSCustomObject]@{ | ||
FileVersion = $Filepath.VersionInfo.FileVersion | ||
ProductVersion = $Filepath.VersionInfo.ProductVersion | ||
FileVersionUpdated = "$($Filepath.VersionInfo.FileMajorPart).$($Filepath.VersionInfo.FileMinorPart).$($Filepath.VersionInfo.FileBuildPart).$($Filepath.VersionInfo.FilePrivatePart)" | ||
ProductVersionUpdated = "$($Filepath.VersionInfo.ProductMajorPart).$($Filepath.VersionInfo.ProductMinorPart).$($Filepath.VersionInfo.ProductBuildPart).$($Filepath.VersionInfo.ProductPrivatePart)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters