To help you better we need some information from you.
*** Please fill in the fields below if you are currently using a Trial Version of the Product. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
32 or 64 bit version of product:64 bit
Operating system: 64 bit
32 or 64 bit OS:
*** Please add details and screenshots as needed below. ***
Powershell studio is not detecting and parsing the script block properly @" "@
see sample code below
$remoteCommand1 =@"
function Get-Todaysfile
{
[CmdletBinding()]
Param (
[Parameter(Position = 0, Mandatory = $true)]
[string]$FolderToTrack,
[Parameter(Position = 1, Mandatory = $true)]
[string]$FileExtensionToTrack,
[Parameter(Position = 2, Mandatory = $true)]
[string]$logfile
)
Process
{
$TodaysDate = Get-Date
$TodaysDate = $TodaysDate.AddSeconds(-$TodaysDate.second)
$TodaysDate = $TodaysDate.AddMinutes(-$TodaysDate.Minute)
$TodaysDate = $TodaysDate.AddHours(-$TodayDate.Hour)
$TomorrowsDate = $TodaysDate.AddDays(+ 1)
if ($FolderToTrack -notmatch '\\$') { $FolderToTrack += '\' }
try
{
$TodaysFile = Get-ChildItem -Path $($FolderToTrack + "*") -Include $FileExtensionToTrack | Where-Object { ($_.LastWriteTime -ge $TodaysDate) -and ($_.LastWriteTime -lt $TomorrowsDate) }
}
catch
{
Write-log -LogString "Function:Get-Todaysfile ==> Error finding todays file." -logfile $logfile
}
}
}
"@
function Find-STRinFile
{
[CmdletBinding()]
Param (
[Parameter(Position = 0, Mandatory = $true)]
[string]$FileName,
[Parameter(Position = 1, Mandatory = $true)]
[string]$StringToFind,
[Parameter(Position = 2, Mandatory = $true)]
[string]$logfile
)
Process
{
$foundmystring = $false
try
{
if (Select-String -Pattern $StringToFind -Path $FileName -Quiet)
{
$foundmystring = $true
# do some action
}
}
catch
{
Write-log -LogString "Function:Find-STRinFile ==> Error searching through the file $FileName file." -logfile $logfile
}
retrun $foundmystring
}
}
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Powershell Studio 2019 not parsing the script blocks
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Powershell Studio 2019 not parsing the script blocks
*** Please fill in the fields below if you are currently using a Trial Version of the Product. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
32 or 64 bit version of product:64 bit
Operating system: 64 bit
32 or 64 bit OS:
Also, please elaborate on what "not parsing properly" means. Please keep in mind that we cannot see your screen.
Product, version and build:
32 or 64 bit version of product:64 bit
Operating system: 64 bit
32 or 64 bit OS:
Also, please elaborate on what "not parsing properly" means. Please keep in mind that we cannot see your screen.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2019 not parsing the script blocks
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.166
OS: Windows 10 Pro (64 Bit)
Build: v10.0.17763.0
Build: v5.6.166
OS: Windows 10 Pro (64 Bit)
Build: v10.0.17763.0
Re: Powershell Studio 2019 not parsing the script blocks
see the difference in grouping, point 3 in pstudio shows its parsing the items after "@ as string. in ms ise, its parsed properly
Re: Powershell Studio 2019 not parsing the script blocks
So far I haven't been able to reproduce the parsing issue you are having.
https://www.sapien.com/support/upload
Could you please upload the your script here:https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2019 not parsing the script blocks
Hello Brittney
The file is now uploaded
Regards
Binu B K
The file is now uploaded
Regards
Binu B K
Re: Powershell Studio 2019 not parsing the script blocks
I have been able to reproduce your issue and have filed an internal bug report.
Thank you for bringing this to our attention. When I have some news to share, I'll be sure to post it here.
As for a temporary solution, the issue was fixed when using Format Script:
Thank you for bringing this to our attention. When I have some news to share, I'll be sure to post it here.
As for a temporary solution, the issue was fixed when using Format Script:
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2019 not parsing the script blocks
Hello Brittney
Thanks for the update... i will put a tail on this thread.
Regard
Binu B K
Thanks for the update... i will put a tail on this thread.
Regard
Binu B K
Re: Powershell Studio 2019 not parsing the script blocks
This issue has been resolved and will be in the next service release.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.