Hey, I´m kinda new into PowerShell and this is my first more complex script. What I meant is extracting informations from log - Free memory and Adapter time. Log is in .txt format and this script is actually working. But, I dont think that this is the correct way how to extract informations from some text file. Any tips for a begginer? Thanks for help
It would help us (and probably even yourself) when you fomrat your code nicely - including indentation and with less needless blank lines.
Regardless of that you could post some example lines of your log file and the expected result. This way we will not have to guess that much.
ProtectToolkit C Configuration Utility 5.6.0
Copyright (c) Safenet, Inc. 2009-2017
Current Adapter Configuration for Device 0:
Model : PSI-E2:PL1500
Batch : 0000
Manufacturing date: 15/08/2018 15:52:06
Serial Number : 579000
Adapter Clock : 25/06/2019 10:57:29 (+1:00+DST)
Board Revision : 6.00
Firmware Version : 5.01.02
Cprov Version : 5.6
Hardware Status : BATTERY OK PCB v0 FPGA v0 EXT PINS 0
Free Memory : 62230528
SM Size Free/Total: 2737552/4091776
Temperature : 46 Deg C
This is example of one output from log. There are many more of those but with exact same infos. What im doing here is extracting just “Free Memory” and “Adapter Clock” into a 2 columns (One with memory, second with Clock"). Also, I get rid of names, so only value remains, for example: