Comments Powershell在没有工作代码更改的情况下出现问题

Comments Powershell在没有工作代码更改的情况下出现问题,comments,echo,hashtable,write-host,Comments,Echo,Hashtable,Write Host,我有几个工作代码点现在不再工作了。下面是一段代码: if ($day -eq 01) { echo "The Day of Days" } else { echo "Not Today" } 我得到以下结果: At D:\PS_Scripts\Archive-Log.ps1:88 char:15 + echo "The Day of Days" } + ~~~ Unexpected token 'The' in expression

我有几个工作代码点现在不再工作了。下面是一段代码:

if ($day -eq 01) {
    echo "The Day of Days" }
else {
    echo "Not Today" }
我得到以下结果:

At D:\PS_Scripts\Archive-Log.ps1:88 char:15
+         echo "The Day of Days" }
+               ~~~
Unexpected token 'The' in expression or statement.
我尝试了Write host,得到了同样的结果:

At D:\PS_Scripts\Archive-Log.ps1:88 char:21
+         Write-Host "The Day of Days" }
+                     ~~~
Unexpected token 'The' in expression or statement.
我还遇到了注释行问题,并得到以下信息:

At D:\PS_Scripts\Archive-Log.ps1:87 char:29
+ #                {($_ -ieq "LOG") } {
+                             ~~~~~~~~~
Unexpected token 'LOG") } {
#                    Write-LogRecord -M $Return.message }
#                {($_ -ieq "NOLOG")} {
#                    Write-Host $Return.message }
#                default {
#                    Write-Host '$msgE1' 
#                    Write-EventLog -LogName Application -Source $global:USER_SOURCE `
#                        -EventID 4001 -EntryType Information -Message "$msgE1"
#                    Write-EventLog -LogName Application -Source $global:USER_SOURCE `
#                        -EventID 2001 -EntryType Error -Message $Return.message } }
我在将哈希表返回到调用程序时也遇到了问题,该程序工作正常,不再工作,如下所示:

Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Collections.Hashtable".
At D:\PS_Scripts\Archive-Log.ps1:82 char:9
+         $ReturnCD = Create-Directory -D $ArchiveDir
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
+ FullyQualifiedErrorId : RuntimeException