Powershell curl header

Powershell Curl with Header In PowerShell, the equivalent to cURL is the Invoke-RestMethod cmdlet. You can use it to make HTTP requests and specify headers as well as other options. To send a request with a custom header, you can use the -Headers parameter followed by a hashtable where each key-value pair represents a header … Read more

How To Calculate Networkdays In Power Bi

Calculating Networkdays in Power BI Power BI does not have a built-in function to directly calculate networkdays. However, you can achieve this by using DAX formulas in Power BI. Here’s how you can do it: Create a calculated table to list all the public holidays: Public Holidays = CALENDAR(DATE(2022, 1, 1), DATE(2022, 12, 31)) This … Read more

Powershell convert xml to string

PowerShell – Convert XML to String In PowerShell, you can convert an XML object to a string using the OuterXml property of the XML object. This property returns the XML representation of the object as a string. Example: $xml = @” <bookstore> <book genre=”novel” publicationdate=”2021-01-01″ ISBN=”123456789″> <title>Sample Book</title> <author>John Doe</author> <price>19.99</price> </book> </bookstore> “@ # … Read more

How To Calculate Mtd In Power Bi

How to calculate MTD in Power BI MTD stands for Month-to-Date, and it is a common requirement to calculate MTD values in Power BI reports. The calculation involves aggregating data from the start of the month up to the current date. Step 1: Create a Date Table Before calculating MTD, you need to have a … Read more

Powershell console readkey

Powershell Console ReadKey Powershell provides the ReadKey function to read a single key from the console input. This function is commonly used to pause the script execution and wait for user input. Here is an example: $keyInfo = $host.UI.RawUI.ReadKey(“NoEcho,IncludeKeyDown”) $key = $keyInfo.Character if ($key -eq “Y” -or $key -eq “y”) { Write-Host “User pressed Yes” … Read more

How To Calculate Moving Average In Power Bi

How to Calculate Moving Average in Power BI The moving average is a commonly used statistical calculation that helps to identify trends in data by smoothing out fluctuations. Power BI provides several ways to calculate moving averages depending on your specific requirements. Here’s an example of how to calculate a simple moving average using Power … Read more

Powershell conda activate not working

PowerShell Conda Activate Not Working When working with PowerShell and Conda, you may encounter issues with activating environments. Here are some possible solutions and explanations: 1. Check PowerShell Execution Policy The PowerShell execution policy may be preventing the activation of Conda environments. You can check and modify the execution policy by running the following commands: … Read more

Powershell compress-archive exclude files

In PowerShell, the “Compress-Archive” cmdlet is used to compress one or more files into a zip archive. It allows excluding specific files or directories from the compression process using the “-ExcludePath” parameter. Here’s an example: $sourcePath = “C:\Path\To\Files” $destinationPath = “C:\Path\To\Archive.zip” $excludePath = “C:\Path\To\Files\Exclude” Compress-Archive -Path $sourcePath -DestinationPath $destinationPath -ExcludePath $excludePath In the above example, … Read more

How To Calculate Mode In Power Bi

How to Calculate Mode in Power BI The mode is a statistical measure that represents the value that appears most frequently in a dataset. In Power BI, you can calculate the mode using DAX (Data Analysis Expressions) formulas. Step 1: Load your data into Power BI Before calculating the mode, you need to import your … Read more