func executePowershellCommands(command, args string) (output []byte, err error) {
	if output, err = cmdExecutor(PowershellCmd, command+" "+args); err != nil {
		log.GetLogger().Errorf("Failed to execute command : %v %v with error - %v",
			command,
			args,
			err.Error())
		log.GetLogger().Debugf("Failed to execute command : %v %v with error - %v",
			command,
			args,
			err.Error())
		log.GetLogger().Debugf("Command Stderr: %v", string(output))
		err = fmt.Errorf("Command failed with error: %v", string(output))
	}
	return
}
executePowershellCommands executes commands in Powershell to get all windows files installed.
package file
import (
	"encoding/json"
	"fmt"
	"os/exec"
	"path/filepath"
	"strings"
	"github.com/aliyun/aliyun_assist_client/agent/util"
	"github.com/aliyun/aliyun_assist_client/agent/util/osutil"
	"github.com/aliyun/aliyun_assist_client/agent/util/stringutil"
	"github.com/aliyun/aliyun_assist_client/agent/log"
	"github.com/aliyun/aliyun_assist_client/agent/inventory/appconfig"
	"github.com/aliyun/aliyun_assist_client/agent/inventory/model"
	"github.com/google/uuid"
)
var (
	startMarker       = "<start" + randomString(8) + ">"
	endMarker         = "<end" + randomString(8) + ">"
	FileInfoBatchSize = 100
	fileInfoScript    = `
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
  function getjson($Paths){
	try {
		$a = Get-ItemProperty -Path $Paths -EA SilentlyContinue |
		SELECT-OBJECT Name,Length,VersionInfo,@{n="LastWriteTime";e={[datetime]::ParseExact($_."LastWriteTime","MM/dd/yyyy HH:mm:ss",$null).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")}},
		@{n="CreationTime";e={[datetime]::ParseExact($_."CreationTime","MM/dd/yyyy HH:mm:ss",$null).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")}},
		@{n="LastAccessTime";e={[datetime]::ParseExact($_."LastAccessTime","MM/dd/yyyy HH:mm:ss",$null).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")}},DirectoryName
		$jsonObj = @()
		foreach ($p in $a) {
			$Name = $p.Name
			$Length = $p.Length
			$Description = $p.VersionInfo.FileDescription
			$Version = $p.VersionInfo.FileVersion
			$InstalledDate = $p.CreationTime
			$LastAccesstime = $p.LastAccessTime
			$ProductName = $p.VersionInfo.ProductName
			$ProductVersion = $p.VersionInfo.ProductVersion
			$ProductLanguage = $p.VersionInfo.Language
			$CompanyName = $p.VersionInfo.CompanyName
			$InstalledDir = $p.DirectoryName
			$ModTime = $p.LastWriteTime
			$jsonObj += @"
{"CompanyName": "` + mark(`$CompanyName`) + `", "ProductName": "` + mark(`$ProductName`) + `", "ProductVersion": "$ProductVersion", "ProductLanguage": "$ProductLanguage", "Name":"$Name", "Size":"$Length",
"Description":"` + mark(`$Description`) + `" ,"FileVersion":"$Version","InstalledDate":"$InstalledDate","LastAccessTime":"$LastAccessTime","InstalledDir":"` + mark(`$InstalledDir`) + `","ModificationTime":"$ModTime"}
"@
		}
		$result = $jsonObj -join ","
		$result = "[" + $result + "]"
		[Console]::WriteLine($result)
	} catch {
		Write-Error $_.Exception.Message
	}
}
getjson -Paths `
)
const (
	PowershellCmd  = "powershell"
	SleepTimeMs    = 5000
	ScriptFileName = "getFileInfo.ps1"
)
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func randomString(length int) string {
	return uuid.New().String()[:length]
}
func mark(s string) string {
	return startMarker + s + endMarker
}
var cmdExecutor = executeCommand
var writeFileText = writeFile
func executeCommand(command string, args ...string) ([]byte, error) {
	return exec.Command(command, args...).CombinedOutput()
}
func expand(s string, mapping func(string) string) (newStr string, err error) {
	newStr, err = stringutil.ReplaceMarkedFields(s, "%", "%", mapping)
	if err != nil {
		return "", err
	}
	return
}