TopMiniSite
- 3 min readIn 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.
- 4 min readIn 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.
- 7 min readWhen 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.
- 3 min readTo 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, ':(.
- 5 min readTo 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.
- 4 min readMultithreading 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.
- 5 min readTo 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.
- 5 min readTo 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.
- 3 min readTo pass a value as a parameter to join tables in Oracle SQL, you can use a WHERE clause in your SQL query. This clause allows you to specify the condition by which the tables should be joined.For example, if you have two tables A and B that you want to join on a specific column, you can pass the value of that column as a parameter in your query.Here's an example query:SELECT * FROM table_A A JOIN table_B B ON A.column_name = B.column_name WHERE A.
- 8 min readTo process custom log data using PowerShell, you can start by reading the log data from a file or another source using the appropriate cmdlet or script. Once you have the log data loaded into PowerShell, you can then parse and analyze it to extract the information you need.One common approach is to use regex (regular expressions) to match patterns in the log data and extract relevant information such as timestamps, log levels, error messages, etc.
- 3 min readTo exclude data based on the weeks in Oracle, you can use the WHERE clause in your SQL query. You can use the WEEKOFYEAR function to extract the week number from a date and then use this information to filter out the data you want to exclude. For example, you can use a condition like WHERE WEEKOFYEAR(date_column) <> some_week_number to exclude data from a specific week.