Skip to main content
TopMiniSite

Posts (page 37)

  • How to Compare Two Folders And Add/Remove Files With Powershell? preview
    7 min read
    To compare two folders and add/remove files with PowerShell, you can use the Compare-Object cmdlet. This cmdlet compares two sets of objects and indicates differences. You can use it to compare files in two folders by specifying the folders as the input objects.First, use the Get-ChildItem cmdlet to retrieve the files in each folder and store them in variables.

  • How to Connect Mongodb With Powershell? preview
    4 min read
    To connect MongoDB with PowerShell, you can use the MongoDB PowerShell module. This module provides cmdlets for interacting with a MongoDB database. To connect to MongoDB using PowerShell, you first need to install the MongoDB PowerShell module using the PowerShell Gallery. Once installed, you can use the Connect-MongoDb cmdlet to establish a connection to your MongoDB database by providing the server and database details.

  • How to Enable Sql Filestream Using Powershell? preview
    6 min read
    To enable SQL filestream using Powershell, you can use the following steps:Open Powershell with administrator privileges.Load the SQL Server module by running the command: Import-Module SQLPSConnect to the SQL Server instance by running the command: $server = New-Object Microsoft.SqlServer.Management.Smo.Server("")Set the filestream access level by running the command: $server.Settings.

  • How to Remotely Execute an Remote Script In Powershell? preview
    7 min read
    To remotely execute a script in PowerShell, you can use the Invoke-Command cmdlet. This cmdlet allows you to run commands on remote computers. First, you need to establish a remote session using the New-PSSession cmdlet and provide the remote computer name. Then, you can use the Invoke-Command cmdlet with the -ScriptBlock parameter to specify the script you want to run remotely. Make sure to include the -Session parameter and provide the session you created earlier.

  • How to Step Backwards In A Path Using Powershell? preview
    3 min read
    In PowerShell, you can step backwards in a path by using the double dot notation. For example, if you are currently in the directory "C:\Users\John\Documents" and you want to move one level up to "C:\Users\John", you can use the command "cd ..". This will take you back one level in the directory structure. You can continue to use ".." to move further up in the directory hierarchy.

  • How to Pass Arguments to A Powershell Commandline? preview
    4 min read
    In Powershell, arguments can be passed to a command line by specifying the argument values after the command name. This can be done by separating the command name and argument values with a space. Arguments can be strings, numbers, or flags that modify the behavior of the command.For example, if you have a script named "myscript.ps1" that accepts two arguments, you can run the script and pass the arguments like this: .\myscript.

  • How to Separate Columns In Powershell When Exported to Csv? preview
    7 min read
    When exporting data to a CSV file in PowerShell, you can separate columns by using a specific delimiter. By default, PowerShell uses a comma (,) as the delimiter when exporting to a CSV file. If you want to use a different delimiter, you can specify it using the -Delimiter parameter when using the Export-CSV cmdlet. For example, if you want to use a tab as the delimiter, you can use the following command: Export-Csv -Path "output.csv" -Delimiter "`t" -NoTypeInformation.

  • How to Extract A Value Inside Column In Certain Pattern In Oracle? preview
    3 min read
    To extract a value inside a column in a certain pattern in Oracle, you can use the REGEXP_SUBSTR function. This function allows you to extract substrings that match a specified regular expression pattern from a column.For example, if you have a column that contains text data in the following format: "Name: John", and you want to extract the value after the colon, you can use the following SQL query:SELECT REGEXP_SUBSTR(column_name, ':(.

  • How to Connect to A Sql Server Database Using Powershell? preview
    5 min read
    To connect to a SQL Server database using PowerShell, you can use the Invoke-Sqlcmd cmdlet provided by the SqlServer module. First, you need to import the SqlServer module by running the Import-Module SqlServer command in your PowerShell session. Then, you can use the Invoke-Sqlcmd cmdlet to connect to the SQL Server database by specifying the server name, database name, and your credentials.

  • How to Perform Multithreading With Powershell? preview
    4 min read
    Multithreading in PowerShell allows for concurrent execution of multiple threads within a script or command. This can be useful for improving performance by utilizing multiple CPU cores or for handling asynchronous tasks.To perform multithreading in PowerShell, you can use the .NET framework's System.Threading namespace, which provides classes for creating and managing threads. You can use the Start-Job cmdlet to start a new background job, which runs in a separate thread.

  • How to Filter on Raw Data Type In Oracle? preview
    5 min read
    To filter on raw data type in Oracle, you can use the RAWTOHEX function to convert the raw data into a hexadecimal representation. This allows you to perform comparisons and filter the raw data based on specific criteria. For example, you can use the WHERE clause in a SQL query to filter raw data using the RAWTOHEX function to convert the raw data into hexadecimal format. Additionally, you can also use comparison operators such as =, >, <, etc.

  • How to Properly Export to Csv Using Powershell? preview
    5 min read
    To properly export to CSV using PowerShell, you can use the Export-Csv cmdlet. First, you need to select the data that you want to export using a command such as Get-Process or Get-Service. Then, pipe that data to Export-Csv with the desired file path where you want to save the CSV file. You can also specify additional parameters such as -NoTypeInformation to exclude the type information from the CSV file.