{"id":634,"date":"2025-08-20T18:35:46","date_gmt":"2025-08-20T16:35:46","guid":{"rendered":"https:\/\/davidka.net\/?p=634"},"modified":"2025-09-22T02:29:40","modified_gmt":"2025-09-22T00:29:40","slug":"powershell-philosophy-part-2","status":"publish","type":"post","link":"https:\/\/it.davidka.net\/it\/powershell-philosophy-part-2\/","title":{"rendered":""},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>\u2757 Important:<\/strong> I am writing about PS7 (PowerShell 7). It is different from PS5 (PowerShell 5). Starting with version 7, PS became cross-platform. Because of this, the behavior of some commands has changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the first part, we established a key principle: PowerShell works with <strong>objects<\/strong>, not text. This post is dedicated to some important PowerShell tools: we will learn how to pass objects through the <strong>pipeline<\/strong>, analyze them with <strong><code class=\"\" data-line=\"\">Get-Member<\/code><\/strong>, save results in <strong>variables<\/strong>, and automate all of this in <strong>script files (<code class=\"\" data-line=\"\">.ps1<\/code>)<\/strong> with <strong>exporting<\/strong> results into convenient formats.<\/p>\n\n\n\n<div id=\"rtoc-mokuji-wrapper\" class=\"rtoc-mokuji-content frame2 preset1 animation-fade rtoc_open default\" data-id=\"634\" data-theme=\"Neve - Davidka\">\n\t\t\t<div id=\"rtoc-mokuji-title\" class=\"rtoc_btn_none rtoc_left\">\n\t\t\t\n\t\t\t<span>In Questo Articolo<\/span>\n\t\t\t<\/div><ul class=\"rtoc-mokuji mokuji_ul level-2\"><li class=\"rtoc-item\"><a href=\"#rtoc-1\">1. What is the pipeline (<code class=\"\" data-line=\"\">|<\/code>)?<\/a><ul class=\"rtoc-mokuji mokuji_none level-3\"><li class=\"rtoc-item\"><a href=\"#rtoc-2\">The Classic UNIX Pipeline: A Stream of Text<\/a><ul class=\"rtoc-mokuji mokuji_none level-3\"><li class=\"rtoc-item\"><a href=\"#rtoc-3\">The PowerShell Pipeline: A Stream of Objects<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-4\">Step-by-step breakdown<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-5\">Example with <code class=\"\" data-line=\"\">svchost<\/code> and parameters<\/a><\/li><\/ul><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-6\">2. Variables (Regular and the special <code class=\"\" data-line=\"\">$_<\/code>)<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-7\">3. Get-Member (The Object Inspector)<\/a><ul class=\"rtoc-mokuji mokuji_none level-3\"><li class=\"rtoc-item\"><a href=\"#rtoc-8\">In table form<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-9\">Example: Working with process windows<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-10\">Example: Find the parent process<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-11\">4. The *.ps1* file (Creating scripts)<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-12\">5. Exporting results<\/a><\/li><li class=\"rtoc-item\"><a href=\"#rtoc-13\">Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ol><\/div><h3 id=\"rtoc-1\"  class=\"wp-block-heading\">1. What is the pipeline (<code class=\"\" data-line=\"\">|<\/code>)?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline in PowerShell is a mechanism for passing full-fledged .NET objects (not just text) from one command to another, where each subsequent cmdlet receives structured objects with all their properties and methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code class=\"\" data-line=\"\">|<\/code> (pipe) symbol is the pipeline operator. Its job is to take the result (output) of the command to its left and pass it as input to the command on its right.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">Command 1 (creates objects)<\/code> \u2192 <code class=\"\" data-line=\"\">|<\/code> \u2192 <code class=\"\" data-line=\"\">Command 2 (receives and processes objects)<\/code> \u2192 <code class=\"\" data-line=\"\">|<\/code> \u2192 <code class=\"\" data-line=\"\">Command 3 (receives processed objects)<\/code> \u2192 | &#8230;<\/p>\n\n\n\n<h4 id=\"rtoc-2\"  class=\"wp-block-heading\">The Classic UNIX Pipeline: A Stream of Text<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In <code class=\"\" data-line=\"\">bash<\/code>, a <strong>stream of bytes<\/strong> is passed through the pipeline, which is usually interpreted as text.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\"># Find all &#039;nginx&#039; processes and count them\nps -ef | grep &#039;nginx&#039; | wc -l\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code class=\"\" data-line=\"\">ps<\/code> outputs text, <code class=\"\" data-line=\"\">grep<\/code> filters this text, and <code class=\"\" data-line=\"\">wc<\/code> counts the lines. Each utility knows nothing about &#8220;processes&#8221;; it only works with strings.<\/p>\n\n\n\n<h4 id=\"rtoc-3\"  class=\"wp-block-heading\">The PowerShell Pipeline: A Stream of Objects<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong> Let&#8217;s get all processes, sort them by CPU usage, and select the 5 most &#8220;hungry&#8221; ones.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 5\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code class=\"\" data-line=\"\">Get-Process<\/code> creates process <strong>objects<\/strong>. <code class=\"\" data-line=\"\">Sort-Object<\/code> receives these <strong>objects<\/strong> and sorts them by the <code class=\"\" data-line=\"\">CPU<\/code> property. <code class=\"\" data-line=\"\">Select-Object<\/code> receives the sorted <strong>objects<\/strong> and selects the first 5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You probably noticed words in the command that start with a hyphen (-): -Property, -Descending, -First. These are parameters. Parameters are settings, switches, and instructions for a cmdlet. They allow you to control <strong>HOW<\/strong> a command will do its job. Without parameters, a command works in its default mode, but with parameters, you give it specific instructions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Main types of parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Parameter with a value: requires additional information. <code class=\"\" data-line=\"\">-Property CPU<\/code>: We are telling Sort-Object which property to sort by. CPU is the value of the parameter. <code class=\"\" data-line=\"\">-First 5<\/code>: We are telling Select-Object how many objects to select. 5 is the value of the parameter.<\/li>\n\n\n\n<li>Switch parameter (flag): Does not require a value. Its mere presence in the command enables or disables a certain behavior. <code class=\"\" data-line=\"\">-Descending<\/code>: This flag tells Sort-Object to reverse the sort order (from largest to smallest). It doesn&#8217;t need an additional value\u2014it is an instruction in itself.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process -Name &#039;svchost&#039; | Measure-Object\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/2.png\" alt=\"1\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This command answers a very simple question: <strong>&#8220;How many processes named <code class=\"\" data-line=\"\">svchost.exe<\/code> are currently running on my system?&#8221;<\/strong><\/p>\n\n\n\n<h4 id=\"rtoc-4\"  class=\"wp-block-heading\">Step-by-step breakdown<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 1: <code class=\"\" data-line=\"\">Get-Process -Name &#039;svchost&#039;<\/code><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">This part of the command queries the operating system and asks it to find <strong>all<\/strong> running processes whose executable file name is <code class=\"\" data-line=\"\">svchost.exe<\/code>. Unlike processes like <code class=\"\" data-line=\"\">notepad<\/code> (of which there are usually one or two), there are always <strong>many<\/strong> <code class=\"\" data-line=\"\">svchost<\/code> processes in the system. The command will return an <strong>array (collection) of objects<\/strong>, where each object is a separate, full-fledged <code class=\"\" data-line=\"\">svchost<\/code> process with its own unique ID, memory usage, etc. PowerShell has found, for example, 90 <code class=\"\" data-line=\"\">svchost<\/code> processes in the system and now holds a collection of 90 objects.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 2: <code class=\"\" data-line=\"\">|<\/code> (Pipeline Operator)<\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">This symbol takes the collection of 90 <code class=\"\" data-line=\"\">svchost<\/code> objects obtained in the first step and begins to pass them <strong>one by one<\/strong> to the input of the next command.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 3: <code class=\"\" data-line=\"\">Measure-Object<\/code><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Since we called <code class=\"\" data-line=\"\">Measure-Object<\/code> without parameters (such as <code class=\"\" data-line=\"\">-Property<\/code>, <code class=\"\" data-line=\"\">-Sum<\/code>, etc.), it performs its <strong>default<\/strong> operation\u2014it simply counts the number of &#8220;items&#8221; passed to it. One, two, three &#8230; After all the objects have been counted, <code class=\"\" data-line=\"\">Measure-Object<\/code> creates its <strong>own result object<\/strong>, which has a <code class=\"\" data-line=\"\">Count<\/code> property equal to the final number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code class=\"\" data-line=\"\">Count: 90<\/code><\/strong> \u2014 this is the answer to our question. There are 90 <code class=\"\" data-line=\"\">svchost<\/code> processes running. The other fields are empty because we did not ask <code class=\"\" data-line=\"\">Measure-Object<\/code> to perform more complex calculations.<\/p>\n\n\n\n<h4 id=\"rtoc-5\"  class=\"wp-block-heading\">Example with <code class=\"\" data-line=\"\">svchost<\/code> and parameters<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s change our task. Now we want to not just count the <code class=\"\" data-line=\"\">svchost<\/code> processes, but to find out <strong>how much total RAM (in megabytes) they consume together<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, we will need parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code class=\"\" data-line=\"\">-Property WorkingSet64<\/code>: This instruction tells <code class=\"\" data-line=\"\">Measure-Object<\/code>: &#8220;From each <code class=\"\" data-line=\"\">svchost<\/code> object that comes to you, take the numeric value from the <code class=\"\" data-line=\"\">WorkingSet64<\/code> property (this is memory usage in bytes)&#8221;.<\/li>\n\n\n\n<li><code class=\"\" data-line=\"\">-Sum<\/code>: This flag instruction says: &#8220;Add up all these values that you took from the <code class=\"\" data-line=\"\">WorkingSet64<\/code> property&#8221;.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Our new command will look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process -Name &#039;svchost&#039; | Measure-Object -Property WorkingSet64 -Sum\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/3.png\" alt=\"3\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code class=\"\" data-line=\"\">Get-Process<\/code> will find the number of <code class=\"\" data-line=\"\">svchost<\/code> objects.<\/li>\n\n\n\n<li>The pipeline <code class=\"\" data-line=\"\">|<\/code> will pass them to <code class=\"\" data-line=\"\">Measure-Object<\/code>.<\/li>\n\n\n\n<li>But now <code class=\"\" data-line=\"\">Measure-Object<\/code> works differently:\n<ul class=\"wp-block-list\">\n<li>It takes the first <code class=\"\" data-line=\"\">svchost<\/code> object, looks at its <code class=\"\" data-line=\"\">.WorkingSet64<\/code> property (for example, <code class=\"\" data-line=\"\">25000000<\/code> bytes) and remembers this number.<\/li>\n\n\n\n<li>It takes the second object, looks at its <code class=\"\" data-line=\"\">.WorkingSet64<\/code> (for example, <code class=\"\" data-line=\"\">15000000<\/code> bytes) and adds it to the previous one.<\/li>\n\n\n\n<li>&#8230;and so on for all objects.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>As a result, <code class=\"\" data-line=\"\">Measure-Object<\/code> will create a result object, but now it will be different.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code class=\"\" data-line=\"\">Count: 92<\/code><\/strong>: The number of objects.<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">Sum: 1661890560<\/code><\/strong>: This is the total sum of all <code class=\"\" data-line=\"\">WorkingSet64<\/code> values in bytes.<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">Property: WorkingSet64<\/code><\/strong>: This field is now also filled; it informs us which property was used for the calculations.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"rtoc-6\"  class=\"wp-block-heading\">2. Variables (Regular and the special <code class=\"\" data-line=\"\">$_<\/code>)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A variable is a named storage in memory that contains some value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This value can be anything: text, a number, a date, or, most importantly for PowerShell, a whole object or even a collection of objects. A variable name in PowerShell always starts with a dollar sign ($). Examples: $name, $counter, $processList.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The special variable $_?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$_ is shorthand for &#8220;the current object&#8221; or &#8220;this thing here&#8221;. Imagine a conveyor belt in a factory. Different parts (objects) are moving along it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$_ is the very part that is right in front of you (or in front of the processing robot).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The source (Get-Process) dumps a whole box of parts (all processes) onto the conveyor belt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline (|) makes these parts move along the belt one by one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The handler (Where-Object or ForEach-Object) is a robot that looks at each part.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The $_ variable is the very part that is currently in the robot&#8217;s &#8220;hands&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the robot is finished with one part, the conveyor belt feeds it the next one, and $_ will now point to it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s calculate how much total memory the <code class=\"\" data-line=\"\">svchost<\/code> processes use and display the result on the monitor.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\"># 1. Execute the command and save its complex result object to the $svchostMemory variable\n$svchostMemory = Get-Process -Name svchost | Measure-Object -Property WorkingSet64 -Sum\n\n# 2. Now we can work with the saved object. Let&#039;s get the Sum property from it\n$memoryInMB = $svchostMemory.Sum \/ 1MB\n\n# 3. Display the result on the screen using the new variable\nWrite-Host &quot;All svchost processes are using $memoryInMB MB of memory.&quot;\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/4.png\" alt=\"3\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code class=\"\" data-line=\"\">Write-Host<\/code> is a specialized cmdlet whose sole purpose is to <strong>show text directly to the user in the console<\/strong>.<\/li>\n\n\n\n<li>A string in double quotes: <code class=\"\" data-line=\"\">&quot;...&quot;<\/code> is a text string that we pass to the <code class=\"\" data-line=\"\">Write-Host<\/code> cmdlet as an argument. Why double quotes and not single quotes? In PowerShell, there are two types of quotes:\n<ul class=\"wp-block-list\">\n<li><strong>Single (<code class=\"\" data-line=\"\">&#039;...&#039;<\/code>):<\/strong> Create a <strong>literal string<\/strong>. Everything inside them is treated as plain text, without exception.<\/li>\n\n\n\n<li><strong>Double (<code class=\"\" data-line=\"\">&quot;...&quot;<\/code>):<\/strong> Create an <strong>expandable (or substitutable) string<\/strong>. PowerShell &#8220;scans&#8221; such a string for variables (starting with <code class=\"\" data-line=\"\">$<\/code>) and substitutes their values in their place.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code class=\"\" data-line=\"\">$memoryInMB<\/code>. This is the variable in which we <strong>in the previous step<\/strong> of our script put the result of the calculations. When <code class=\"\" data-line=\"\">Write-Host<\/code> receives a string in double quotes, a process called <strong>&#8220;String Expansion&#8221;<\/strong> occurs:\n<ol class=\"wp-block-list\">\n<li>PowerShell sees the text <code class=\"\" data-line=\"\">&quot;All svchost processes are using &quot;<\/code>.<\/li>\n\n\n\n<li>Then it encounters the construct <code class=\"\" data-line=\"\">$memoryInMB<\/code>. It understands that this is not just text, but a variable.<\/li>\n\n\n\n<li>It looks into memory, finds the value stored in <code class=\"\" data-line=\"\">$memoryInMB<\/code> (for example, <code class=\"\" data-line=\"\">1585.52<\/code>).<\/li>\n\n\n\n<li>It <strong>substitutes this value<\/strong> directly into the string.<\/li>\n\n\n\n<li>Then it adds the rest of the text: <code class=\"\" data-line=\"\">&quot; MB of memory.&quot;<\/code>.<\/li>\n\n\n\n<li>As a result, the already assembled string is passed to <code class=\"\" data-line=\"\">Write-Host<\/code>: <code class=\"\" data-line=\"\">&quot;All svchost processes are using 1585.52 MB of memory.&quot;<\/code>.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Start Notepad:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Find the Notepad process and save it to the $notepadProcess variable<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">$notepadProcess = Get-Process -Name notepad\n<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Access the &#8216;Id&#8217; property of this object through the dot and display it<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Write-Host &quot;The ID of the &#039;Notepad&#039; process is: $($notepadProcess.Id)&quot;\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/5.png\" alt=\"5\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u2757 Important:<\/strong> Write-Host &#8220;breaks&#8221; the pipeline. The text output by it cannot be passed further down the pipeline for processing. It is intended for display only.<\/p>\n\n\n\n<h3 id=\"rtoc-7\"  class=\"wp-block-heading\">3. Get-Member (The Object Inspector)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We know that objects &#8220;flow&#8221; through the pipeline. But how do we know what they are made of? What properties do they have and what actions (methods) can be performed on them?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong><code class=\"\" data-line=\"\">Get-Member<\/code><\/strong> cmdlet (alias: <code class=\"\" data-line=\"\">gm<\/code>) is the main tool for investigation. Before working with an object, pass it through <code class=\"\" data-line=\"\">Get-Member<\/code> to see all its capabilities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s analyze the objects that <code class=\"\" data-line=\"\">Get-Process<\/code> creates:<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process | Get-Member\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/6.png\" alt=\"6\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Let&#8217;s break down each part of the Get-Member output.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">TypeName: System.Diagnostics.Process<\/code> &#8211; This is the full, official &#8220;type name&#8221; of the object from the .NET library. This is its &#8220;passport&#8221;. This line tells you that all objects returned by Get-Process are objects of type System.Diagnostics.Process. This guarantees that they will all have the same set of properties and methods. You can <a href=\"https:\/\/www.google.com\/search?q=System.Diagnostics.Process+site%3Amicrosoft.com\">google<\/a> &#8220;System.Diagnostics.Process&#8221; to find the official Microsoft documentation with even more detailed information.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Column 1: <code class=\"\" data-line=\"\">Name<\/code> This is a simple, human-readable <strong>name<\/strong> of a property, method, or other &#8220;member&#8221; of an object. This is the name you will use in your code to access data or perform actions.<\/li>\n\n\n\n<li>Column 2: <code class=\"\" data-line=\"\">MemberType<\/code> (Type of object) This is the most important column to understand. It classifies <strong>what<\/strong> each member is. This is its &#8220;job title&#8221; that tells you <strong>HOW<\/strong> to use it.\n<ul class=\"wp-block-list\">\n<li><strong><code class=\"\" data-line=\"\">Property<\/code>:<\/strong> a <strong>characteristic<\/strong> or <strong>piece of data<\/strong> stored inside an object. You can &#8220;read&#8221; its value.\n<ul class=\"wp-block-list\">\n<li><em>Examples from the screenshot:<\/em> <code class=\"\" data-line=\"\">BasePriority<\/code>, <code class=\"\" data-line=\"\">HandleCount<\/code>, <code class=\"\" data-line=\"\">ExitCode<\/code>. This is just data that can be viewed.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">Method<\/code>:<\/strong> an <strong>ACTION<\/strong> that can be performed on an object. Methods are always called with parentheses <code class=\"\" data-line=\"\">()<\/code>.\n<ul class=\"wp-block-list\">\n<li><em>Examples from the screenshot:<\/em> <code class=\"\" data-line=\"\">Kill<\/code>, <code class=\"\" data-line=\"\">Refresh<\/code>, <code class=\"\" data-line=\"\">WaitForExit<\/code>. You would write <code class=\"\" data-line=\"\">$process.Kill()<\/code> or <code class=\"\" data-line=\"\">$process.Refresh()<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">AliasProperty<\/code>:<\/strong> a <strong>friendly alias<\/strong> for another, longer property. PowerShell adds them for convenience and brevity.\n<ul class=\"wp-block-list\">\n<li><em>Examples from the screenshot:<\/em> <code class=\"\" data-line=\"\">WS<\/code> is a short alias for <code class=\"\" data-line=\"\">WorkingSet64<\/code>. <code class=\"\" data-line=\"\">Name<\/code> is for <code class=\"\" data-line=\"\">ProcessName<\/code>. <code class=\"\" data-line=\"\">VM<\/code> is for <code class=\"\" data-line=\"\">VirtualMemorySize64<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">Event<\/code>:<\/strong> a <strong>NOTIFICATION<\/strong> that something has happened, to which you can &#8220;subscribe&#8221;.\n<ul class=\"wp-block-list\">\n<li><em>Example from the screenshot:<\/em> <code class=\"\" data-line=\"\">Exited<\/code>. Your script can &#8220;listen&#8221; for this event to perform some action immediately after the process terminates.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">CodeProperty<\/code> and <code class=\"\" data-line=\"\">NoteProperty<\/code>:<\/strong> special types of properties, often added by PowerShell itself for convenience. A <code class=\"\" data-line=\"\">CodeProperty<\/code> calculates its value &#8220;on the fly&#8221;, and a <code class=\"\" data-line=\"\">NoteProperty<\/code> is a simple note property added to an object.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Column 3: <code class=\"\" data-line=\"\">Definition<\/code> This is the <strong>technical definition<\/strong> or &#8220;signature&#8221; of the member. It gives you the exact details for its use. Its content depends on the <code class=\"\" data-line=\"\">MemberType<\/code>:\n<ul class=\"wp-block-list\">\n<li><strong>For <code class=\"\" data-line=\"\">AliasProperty<\/code>:<\/strong> Shows <strong>what the alias is equal to<\/strong>. This is incredibly useful!\n<ul class=\"wp-block-list\">\n<li><em>Example from the screenshot:<\/em> <code class=\"\" data-line=\"\">WS = WorkingSet64<\/code>. You can immediately see that <code class=\"\" data-line=\"\">WS<\/code> is just a short notation for <code class=\"\" data-line=\"\">WorkingSet64<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>For <code class=\"\" data-line=\"\">Property<\/code>:<\/strong> Shows the <strong>data type<\/strong> stored in the property (e.g., <code class=\"\" data-line=\"\">int<\/code> for an integer, <code class=\"\" data-line=\"\">string<\/code> for text, <code class=\"\" data-line=\"\">datetime<\/code> for a date and time), and what you can do with it (<code class=\"\" data-line=\"\">{get;}<\/code> &#8211; read only, <code class=\"\" data-line=\"\">{get;set;}<\/code> &#8211; read and write).\n<ul class=\"wp-block-list\">\n<li><em>Example from the screenshot:<\/em> <code class=\"\" data-line=\"\">int BasePriority {get;}<\/code>. This is an integer property that can only be read.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>For <code class=\"\" data-line=\"\">Method<\/code>:<\/strong> Shows what the method returns (e.g., <code class=\"\" data-line=\"\">void<\/code> &#8211; nothing, <code class=\"\" data-line=\"\">bool<\/code> &#8211; true\/false) and what <strong>parameters<\/strong> (input data) it accepts in parentheses.\n<ul class=\"wp-block-list\">\n<li><em>Example from the screenshot:<\/em> <code class=\"\" data-line=\"\">void Kill()<\/code>. This means that the <code class=\"\" data-line=\"\">Kill<\/code> method returns nothing and can be called without parameters. There is also a second version <code class=\"\" data-line=\"\">void Kill(bool entireProcessTree)<\/code> that accepts a boolean value (true\/false).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 id=\"rtoc-8\"  class=\"wp-block-heading\">In table form<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Column<\/th><th>What is it?<\/th><th>Example from screenshot<\/th><th>What for?<\/th><\/tr><\/thead><tbody><tr><td><strong>Name<\/strong><\/td><td>The name you use in your code.<\/td><td><code class=\"\" data-line=\"\">Kill<\/code>, <code class=\"\" data-line=\"\">WS<\/code>, <code class=\"\" data-line=\"\">Name<\/code><\/td><td>to access a property or method (<code class=\"\" data-line=\"\">$process.WS<\/code>, <code class=\"\" data-line=\"\">$process.Kill()<\/code>).<\/td><\/tr><tr><td><strong>MemberType<\/strong><\/td><td>The type of member (data, action, etc.).<\/td><td><code class=\"\" data-line=\"\">Method<\/code>, <code class=\"\" data-line=\"\">Property<\/code>, <code class=\"\" data-line=\"\">AliasProperty<\/code><\/td><td><strong>how<\/strong> to use it (read a value or call with <code class=\"\" data-line=\"\">()<\/code>).<\/td><\/tr><tr><td><strong>Definition<\/strong><\/td><td>Technical details.<\/td><td><code class=\"\" data-line=\"\">WS = WorkingSet64<\/code>, <code class=\"\" data-line=\"\">void Kill()<\/code><\/td><td>what is hidden behind an alias and what parameters a method needs.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 id=\"rtoc-9\"  class=\"wp-block-heading\">Example: Working with process windows<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">1. The problem:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;I have opened many Notepad windows. How can I programmatically minimize all but the main one, and then close only the one that has the word &#8216;Untitled&#8217; in its title?&#8221;<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2. Investigation with <code class=\"\" data-line=\"\">Get-Member<\/code>:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">We need to find properties related to the window and its title.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process -Name notepad | Get-Member\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Analysis of the <code class=\"\" data-line=\"\">Get-Member<\/code> result:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scrolling through the properties, we find <code class=\"\" data-line=\"\">MainWindowTitle<\/code>. The type is <code class=\"\" data-line=\"\">string<\/code>. Great, this is the title of the main window!<\/li>\n\n\n\n<li>In the methods, we see <code class=\"\" data-line=\"\">CloseMainWindow()<\/code>. This is a &#8220;softer&#8221; way to close a window than <code class=\"\" data-line=\"\">Kill()<\/code>.<\/li>\n\n\n\n<li>Also in the methods, there is <code class=\"\" data-line=\"\">WaitForInputIdle()<\/code>. This sounds interesting; perhaps it will help to wait until the process is ready for interaction.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/7.png\" alt=\"7\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code class=\"\" data-line=\"\">Get-Member<\/code> showed us the <code class=\"\" data-line=\"\">MainWindowTitle<\/code> property, which is the key to solving the problem and allows us to interact with processes based on the state of their windows, and not just by name.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">3. The solution:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Now we can build logic based on the window title.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\"># 1. Find all Notepad processes\n$notepads = Get-Process -Name notepad\n\n# 2. Go through each one and check the title\nforeach ($pad in $notepads) {\n    # For each process ($pad), check its MainWindowTitle property\n    if ($pad.MainWindowTitle -like &#039;*Untitled*&#039;) {\n        Write-Host &quot;Found an unsaved Notepad (ID: $($pad.Id)). Closing its window...&quot;\n        # $pad.CloseMainWindow() # Uncomment to actually close\n        Write-Host &quot;The window &#039;$($pad.MainWindowTitle)&#039; would have been closed.&quot; -ForegroundColor Yellow\n    } else {\n        Write-Host &quot;Skipping Notepad with title: $($pad.MainWindowTitle)&quot;\n    }\n}\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/8.png\" alt=\"8\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/9.png\" alt=\"9\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 id=\"rtoc-10\"  class=\"wp-block-heading\">Example: Find the parent process<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">1. The problem:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;Sometimes I see a lot of child <code class=\"\" data-line=\"\">chrome.exe<\/code> processes in the system. How can I find out which one is the main, &#8220;parent&#8221; process that launched them all?&#8221;<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2. Investigation with <code class=\"\" data-line=\"\">Get-Member<\/code>:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">We need to find something that links one process to another.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Get-Process -Name chrome | Select-Object -First 1 | Get-Member\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/10.png\" alt=\"10\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Analysis of the <code class=\"\" data-line=\"\">Get-Member<\/code> result:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Carefully looking through the list, we find a property of type <code class=\"\" data-line=\"\">CodeProperty<\/code> named <code class=\"\" data-line=\"\">Parent<\/code>.<\/li>\n\n\n\n<li>Its <code class=\"\" data-line=\"\">Definition<\/code> is <code class=\"\" data-line=\"\">System.Diagnostics.Process Parent{get=GetParentProcess;}<\/code>. This is a calculated property that, when accessed, returns the <strong>parent process object<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">3. The solution:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Now we can write a script that, for each <code class=\"\" data-line=\"\">chrome<\/code> process, will display information about its parent.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\"># 1. Get all chrome processes\n$chromeProcesses = Get-Process -Name chrome\n\n# 2. For each of them, display information about it and its parent\n$chromeProcesses | Select-Object -First 5 | ForEach-Object {\n    # Get the parent process\n    $parent = $_.Parent\n\n    # Format a nice output\n    Write-Host &quot;Process:&quot; -ForegroundColor Green\n    Write-Host &quot;  - Name: $($_.ProcessName), ID: $($_.Id)&quot;\n    Write-Host &quot;Its parent:&quot; -ForegroundColor Yellow\n    Write-Host &quot;  - Name: $($parent.ProcessName), ID: $($parent.Id)&quot;\n    Write-Host &quot;-----------------------------&quot;\n}\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/11.png\" alt=\"11\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"assets\/02\/12.png\" alt=\"12\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can immediately see that the processes with IDs 4756, 7936, 8268, and 9752 were launched by the process with ID 14908. We can also notice an interesting case with the process ID: 7252, whose parent process was not determined (perhaps the parent had already terminated by the time of the check). Modifying the script with an if ($parent) check neatly handles this case without causing an error. Get-Member helped us discover the &#8220;hidden&#8221; Parent property, which provides powerful capabilities for analyzing the process hierarchy.<\/p>\n\n\n\n<h4 id=\"rtoc-11\"  class=\"wp-block-heading\">4. The *.ps1* file (Creating scripts)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">When your command chain becomes useful, you will want to save it for repeated use. This is what <strong>scripts<\/strong> are for\u2014text files with the <strong><code class=\"\" data-line=\"\">.ps1<\/code><\/strong> extension.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Permission to run scripts<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Windows prohibits the execution of local scripts. To fix this <strong>for the current user<\/strong>, run the following once in PowerShell <strong>as an administrator<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">Set-ExecutionPolicy RemoteSigned -Scope CurrentUser\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is a safe setting that allows you to run your own scripts and scripts signed by a trusted publisher.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Example script <code class=\"\" data-line=\"\">system_monitor.ps1<\/code><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Create a file with this name and paste the code below into it. This script collects system information and generates reports.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\"># system_monitor.ps1\n#requires -Version 5.1\n&lt;#\n.SYNOPSIS\n    A script to create a system status report.\n.DESCRIPTION\n    Collects information about processes, services, and disk space and generates reports.\n.PARAMETER OutputPath\n    The path to save the reports. Defaults to &#039;C:\\Temp&#039;.\n.EXAMPLE\n    .\\system_monitor.ps1 -OutputPath &quot;C:\\Reports&quot;\n#&gt;\nparam(\n    &#091;Parameter(Mandatory=$false)]\n    &#091;string]$OutputPath = &quot;C:\\Temp&quot;\n)\n# --- Block 1: Preparation ---\nWrite-Host &quot;Preparing to create the report...&quot; -ForegroundColor Cyan\nif (!(Test-Path $OutputPath)) {\n    New-Item -ItemType Directory -Path $OutputPath -Force | Out-Null\n}\n# --- Block 2: Data collection ---\nWrite-Host &quot;Collecting information...&quot; -ForegroundColor Green\n$processes = Get-Process | Sort-Object CPU -Descending\n$services = Get-Service | Group-Object Status | Select-Object Name, Count\n# --- Block 3: Calling the export function (see next section) ---\nExport-Results -Processes $processes -Services $services -OutputPath $OutputPath\nWrite-Host &quot;Reports successfully saved to the $OutputPath folder&quot; -ForegroundColor Magenta\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Note: The <code class=\"\" data-line=\"\">Export-Results<\/code> function will be defined in the next section as an example of good practice.<\/em><\/p>\n\n\n\n<h4 id=\"rtoc-12\"  class=\"wp-block-heading\">5. Exporting results<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Raw data is good, but often it needs to be presented in a form that is convenient for a person or another program. PowerShell offers many cmdlets for exporting.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Method<\/th><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>Plain text<\/strong><\/td><td><code class=\"\" data-line=\"\">... \\| Out-File C:\\Temp\\data.txt<\/code><\/td><td>Redirects the text representation to a file.<\/td><\/tr><tr><td><strong>CSV (for Excel)<\/strong><\/td><td><code class=\"\" data-line=\"\">... \\| Export-Csv C:\\Temp\\data.csv -NoTypeInfo<\/code><\/td><td>Exports objects to CSV. <code class=\"\" data-line=\"\">-NoTypeInfo<\/code> removes the service first line.<\/td><\/tr><tr><td><strong>HTML report<\/strong><\/td><td><code class=\"\" data-line=\"\">... \\| ConvertTo-Html -Title &quot;Report&quot;<\/code><\/td><td>Creates HTML code from objects.<\/td><\/tr><tr><td><strong>JSON (for API, web)<\/strong><\/td><td><code class=\"\" data-line=\"\">... \\| ConvertTo-Json<\/code><\/td><td>Converts objects to JSON format.<\/td><\/tr><tr><td><strong>XML (PowerShell&#8217;s native format)<\/strong><\/td><td><code class=\"\" data-line=\"\">... \\| Export-Clixml C:\\Temp\\data.xml<\/code><\/td><td>Saves objects with all data types. They can be perfectly restored via <code class=\"\" data-line=\"\">Import-Clixml<\/code>.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Addition to the script: export function<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s add a function to our <code class=\"\" data-line=\"\">system_monitor.ps1<\/code> script that will handle exporting. Place this code <strong>before<\/strong> the <code class=\"\" data-line=\"\">Export-Results<\/code> call.<\/p>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code class=\" language-python\" data-line=\"\">function Export-Results {\n    param(\n        $Processes,\n        $Services,\n        $OutputPath\n    )\n\n    $timestamp = Get-Date -Format &quot;yyyy-MM-dd_HH-mm&quot;\n\n    # Export to CSV\n    $Processes | Select-Object -First 20 | Export-Csv (Join-Path $OutputPath &quot;processes_$timestamp.csv&quot;) -NoTypeInformation\n    $Services | Export-Csv (Join-Path $OutputPath &quot;services_$timestamp.csv&quot;) -NoTypeInformation\n\n    # Create a nice HTML report\n    $htmlReportPath = Join-Path $OutputPath &quot;report_$timestamp.html&quot;\n    $processesHtml = $Processes | Select-Object -First 10 Name, Id, CPU | ConvertTo-Html -Fragment -PreContent &quot;&lt;h2&gt;Top 10 processes by CPU&lt;\/h2&gt;&quot;\n    $servicesHtml = $Services | ConvertTo-Html -Fragment -PreContent &quot;&lt;h2&gt;Service statistics&lt;\/h2&gt;&quot;\n\n    ConvertTo-Html -Head &quot;&lt;title&gt;System Report&lt;\/title&gt;&quot; -Body &quot;&lt;h1&gt;System report from $(Get-Date)&lt;\/h1&gt; $($processesHtml) $($servicesHtml)&quot; | Out-File $htmlReportPath\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now our script not only collects data, but also neatly saves it in two formats: CSV for analysis and HTML for quick viewing.<\/p>\n\n\n\n<h4 id=\"rtoc-13\"  class=\"wp-block-heading\">Conclusion<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>The pipeline (<code class=\"\" data-line=\"\">|<\/code>)<\/strong> is the main tool for combining commands and processing objects.<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">Get-Member<\/code><\/strong> is an object analyzer that shows what they are made of.<\/li>\n\n\n\n<li><strong>Variables (<code class=\"\" data-line=\"\">$var<\/code>, <code class=\"\" data-line=\"\">$_<\/code>)<\/strong> allow you to save data and refer to the current object in the pipeline.<\/li>\n\n\n\n<li><strong><code class=\"\" data-line=\"\">.ps1<\/code> files<\/strong> turn commands into reusable automation tools.<\/li>\n\n\n\n<li><strong>Export cmdlets<\/strong> (<code class=\"\" data-line=\"\">Export-Csv<\/code>, <code class=\"\" data-line=\"\">ConvertTo-Html<\/code>) export data in the appropriate format.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>In the next part, we will apply this knowledge to navigate and manage the file system, exploring the <code class=\"\" data-line=\"\">System.IO.DirectoryInfo<\/code> and <code class=\"\" data-line=\"\">System.IO.FileInfo<\/code> objects.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2757 Important: I am writing about PS7 (PowerShell 7). It is different from PS5 (PowerShell 5). Starting with version 7, PS became cross-platform. Because of this, the behavior of some commands has changed. In the first part, we established a key principle: PowerShell works with objects, not text. This post is dedicated to some important&hellip;&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"left","neve_meta_author_avatar":"on","neve_post_elements_order":"[\"content\",\"tags\",\"comments\"]","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[624],"tags":[765],"class_list":["post-634","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-ms-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/posts\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/comments?post=634"}],"version-history":[{"count":0,"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/posts\/634\/revisions"}],"wp:attachment":[{"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/media?parent=634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/categories?post=634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.davidka.net\/it\/wp-json\/wp\/v2\/tags?post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}