Skip to content

Commit

Permalink
Appemt to hide powershell window when running script
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah-Kolide committed Jan 29, 2025
1 parent 05324eb commit 258d102
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ee/tables/ntfs_ads_zone_id/zone_identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (t *Table) generate(ctx context.Context, queryContext table.QueryContext) (
for _, path := range paths {
for _, dataQuery := range tablehelpers.GetConstraints(queryContext, "query", tablehelpers.WithDefaults("*")) {
var output bytes.Buffer
if err := tablehelpers.Run(ctx, t.slogger, 30, allowedcmd.Powershell, []string{"-WindowStyle", "Hidden", "{", "Get-Content", "-Path", filepath.Clean(path), "-Stream", "Zone.Identifier", "-ErrorAction", "Ignore", "}"}, &output, &output); err != nil {
if err := tablehelpers.Run(ctx, t.slogger, 30, allowedcmd.Powershell, []string{"-WindowStyle", "Hidden", "-Command", "'", "Get-Content", "-Path", filepath.Clean(path), "-Stream", "Zone.Identifier", "-ErrorAction", "Ignore", "'"}, &output, &output); err != nil {
t.slogger.Log(ctx, slog.LevelInfo, "failure running powershell get-content command", "err", err, "path", path)
continue
}
Expand Down

0 comments on commit 258d102

Please sign in to comment.