ps/Modules/Alkami.DevOps.Inventory/Public/Save-MachineManifest.ps1
2023-05-30 22:51:22 -07:00

34 lines
886 B
PowerShell

function Save-MachineManifest {
<#
.SYNOPSIS
Saves a json manifest to the specified location. Defaults to c:\temp\manifest if not supplied
.EXAMPLE
Save-MachineManifest
This will save a manifest for the local machine at c:\temp\manifest
Save-MachineManifest -Folder "c:\temp\foo"
This will save a manifest of the local machine to "c:\temp\foo"
.PARAMETER outputFolder
Optional output location
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[Alias("Folder")]
[string]$outputFolder = "c:\temp\manifest"
)
if(!(Test-Path $outputFolder))
{
New-Item -Path $defaultTempFileLocation -ItemType "directory"
}
$filename = "$outputFolder\$env:computername.json"
Get-MachineInventory -filter chocolatey -asJson | Out-File -FilePath $filename
}