Alkane Solutions
Alkane Solutions Fixed-Price Application Packaging | Trusted IT Partner
Alkane Solutions | G-Cloud Supplier Alkane Solutions | Microsoft Partner

Main menu

Skip to primary content
Skip to secondary content
  • Hire Us
    • End User Compute
      • Software Services
      • Hardware Services
      • Licensing Services
      • Security Services
      • Support Services
    • Tooling and Automation
      • Bespoke Tooling Services
      • Robotic Process Automation Services
    • Web
      • Web Hosting Services
      • Web Development Services
    • Team
    • Case StudiesCase studies of the work we have done for our clients.
  • Contact Us
  • Log In
  • Register

Home » General Scripting and Coding » Page 3

General scripting and coding


Using PowerShell Try and Catch for Handling Errors

Posted on October 13th, 2023

Like any programming or scripting language, errors can occur during execution. To handle and manage these errors gracefully, PowerShell provides the Try and Catch blocks. In this blog post, we’ll explore using PowerShell try and catch for handling errors. PowerShell … Continue reading →

Tagged catch, try |

Using the PowerShell For Loop and ForEach-Object Cmdlet

Posted on October 13th, 2023

In this blog post, we’ll explore using the PowerShell For loop and ForEach-Object cmdlet effectively in our scripts. The PowerShell For Loop The For loop is a traditional loop that allows us to execute a block of code a specified … Continue reading →

Tagged foreach-object |

Use PowerShell Start-Sleep to Pause Script Execution

Posted on October 13th, 2023

There are various situations where we may need to introduce delays or pauses in our scripts to ensure proper execution or to control the timing of specific actions. Here we demonstrate how to use PowerShell start-sleep to pause script execution. … Continue reading →

Tagged start-sleep |

Use Where-Object in PowerShell Scripts

Posted on October 13th, 2023

We can use Where-Object in PowerShell scripts to filter objects based on specific conditions. Where-Object is commonly used with collections like arrays and lists to extract only the elements that meet certain criteria. The basic syntax of Where-Object is as … Continue reading →

Tagged where-object |

Use the PowerShell If Statement and PowerShell Switch Statement

Posted on October 13th, 2023

When it comes to making decisions and branching logic in our PowerShell scripts, we commonly use the PowerShell If statement and PowerShell Switch statement. The PowerShell If Statement The If statement is a fundamental control structure in almost every programming … Continue reading →

Tagged if statement, switch statement |

Use PowerShell to Output Text to a File

Posted on October 13th, 2023

There a various ways we can use PowerShell to output text to a file.  And we’ll discuss a few options throughout this blog. Use Set-Content and Add-Content to Output Text to a File The first approach is to use the … Continue reading →

Tagged add-content, out-file, set-content |

Launch a Process using PowerShell and Start-Process

Posted on September 7th, 2023

This blog post explains how we can launch a process using PowerShell and Start-Process. In its most simplistic form, we can launch a process and essentially forget about it.  In this example we’re going to launch Google Chrome.  You will … Continue reading →

Tagged Start-Process |

Use PowerShell Copy-Item to Copy a File or Folder Including Mirror Copy

Posted on September 6th, 2023

This post explains how to use PowerShell Copy-Item to copy a file or folder including mirror copy! Throughout this example, consider that we have created the following folder/file structure: C:\alkanesource │ file1.txt │ file2.log │ file3.zip └───alkanesubfolder │ file4.ps1 C:\alkanedestination … Continue reading →

Tagged copy-item |

PowerShell Grep and Findstr Equivalent Using the Select-String Cmdlet

Posted on September 5th, 2023

This post explores a PowerShell Grep and FindStr equivalent using the Select-String cmdlet. Grep (Unix) and FindStr (Windows) are command line utilities used for searching text patterns within input strings and files.  By using PowerShell’s Select-String cmdlet with regular expressions, … Continue reading →

Tagged grep, select-string |

Use the PowerShell Substring Method to Extract and Match Part of a String

Posted on September 5th, 2023

This post explains how we can use the PowerShell substring method to extract and match part of a string. Before we continue, it’s important to remember that the first index of a string starts at position 0.  So in the … Continue reading →

Tagged substring |

« Previous Page — « Previous Entries
Next Entries » — Next Page »

Contact Us!


    Your Name (required)

    Your Email (required)

    Subject

    Your Message

    Over

    15,000

    Applications
    Packaged

    Over

    27

    Successful
    Migrations

    Over

    100

    Happy
    Clients

    Application Packaging Services in Manchester, UK.
    12b Kennerleys Lane, Wilmslow, England, SK9 5EQ

    Application Packaging Services in London, UK.
    152-160 City Road, London, EC1V 2NX.

    © Alkane Solutions Ltd 2025
    Privacy Policy | Modern Slavery | LinkedIn | Blog Posts