File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change 48
48
49
49
. NOTES
50
50
Author: Blake Drumm
51
- Version: 1.4
51
+ Version: 1.5
52
52
Created: November 17th, 2023
53
53
Modified: March 18th, 2024
54
54
#>
@@ -540,15 +540,9 @@ function Invoke-SCXWinRMEnumeration
540
540
# Output handling
541
541
if ($OutputType -eq ' CSV' )
542
542
{
543
- if ($OutputType -match ' Text' )
544
- {
545
- $ParentDirectory = Split-Path $OutputFile
546
- $OutputPath = " $ParentDirectory \$ ( [System.IO.Path ]::GetFileNameWithoutExtension($OutputFile )) .csv"
547
- }
548
- else
549
- {
550
- $OutputPath = $OutputFile
551
- }
543
+ $ParentDirectory = Split-Path $OutputFile
544
+ $OutputPath = " $ParentDirectory \$ ( [System.IO.Path ]::GetFileNameWithoutExtension($OutputFile )) .csv"
545
+
552
546
if ($results -match " Error for" )
553
547
{
554
548
$results | Out-File - FilePath $OutputPath - ErrorAction Stop
@@ -565,15 +559,9 @@ function Invoke-SCXWinRMEnumeration
565
559
}
566
560
if ($OutputType -eq ' Text' )
567
561
{
568
- if ($OutputType -match ' CSV' )
569
- {
570
- $ParentDirectory = Split-Path $OutputFile
571
- $OutputPath = " $ParentDirectory \$ ( [System.IO.Path ]::GetFileNameWithoutExtension($OutputFile )) .txt"
572
- }
573
- else
574
- {
575
- $OutputPath = $OutputFile
576
- }
562
+ $ParentDirectory = Split-Path $OutputFile
563
+ $OutputPath = " $ParentDirectory \$ ( [System.IO.Path ]::GetFileNameWithoutExtension($OutputFile )) .txt"
564
+
577
565
$results | Out-File - FilePath $OutputPath - ErrorAction Stop
578
566
if (-NOT $PassThru )
579
567
{
You can’t perform that action at this time.
0 commit comments