Category : powershell-3.0

I am trying to print Keys and a list of values together in a single string in powershell. I have something like this List(dict(key:value)) (key= string , value=list<String>) so my input is like this dict( "apple"=$list1 "banana"=$list2 "orange"=$list3) [email protected](‘red’,’green’) [email protected](‘yellow’,’black’) [email protected](‘orange’) Now I want output something like that: $Final_ans= apple,red_green banana,yellow_black orange,orange How can I ..

Read more

So, I am writing this script in powershell and I am required to delete a few file in APPDATA on windows. I wrote this line of code and it doesn’t remove the item silently. It asks for confirmation even after using $Confirm:false. How do I fix this issue? My code: Get-ChildItem -Path $env:APPDATA"Microsoftteamsblob_storage" | Remove-Item ..

Read more

step-1 we have to go the location path -eg -C:Jobslogs. step-2 open the log file with current date in format-‘YYYY-MM-DD’(eg-2021-06-16.log). step-3 for completion time which will be input. In this scenario-5:02:21. I have to print the count values for the below sample log text. 2021-06-16 03:30:00.7185 INFO Running GetCallGenForFullRun query 2021-06-16 03:32:49.1254 INFO Query complete. ..

Read more

I want to write a PowerShell script for deleting a folder automatically using notepad and I also want to add 2 parameters to this script. Whenever I run this script it asks for path and no. of days old file. Param1 – location of the folder Param2 – no. Of days to keep $param1 = ..

Read more