<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scripting Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 29 Jun 2021 00:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Enable PowerShell Script Execution</title>
		<link>https://www.osradar.com/how-to-enable-powershell-script-execution/</link>
					<comments>https://www.osradar.com/how-to-enable-powershell-script-execution/#respond</comments>
		
		<dc:creator><![CDATA[roger]]></dc:creator>
		<pubDate>Sat, 03 Jul 2021 09:13:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[powershell script]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=31027</guid>

					<description><![CDATA[<p>Hello, how are you? You have probably tried to run scripts in PowerShell in Windows. However, you will not be able to proceed as the tool displays an error message. This message indicates that you cannot continue because there is a restriction. So, read on to find out how to enable script execution in PowerShell. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-enable-powershell-script-execution/">How to Enable PowerShell Script Execution</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hello, how are you? You have probably tried to run scripts in PowerShell in <a href="https://www.microsoft.com/en-us/software-download/windows10" target="_blank" rel="noreferrer noopener">Windows.</a> However, you will not be able to proceed as the tool displays an error message. This message indicates that you cannot continue because there is a restriction. So, read on to find out how to enable script execution in PowerShell.</p>



<h2>What are Scripts?</h2>



<p>Scripts are lines of code that make up a specific function or application. They are also considered to be widely used software tools. Since they are characterized by being very practical and effective. It is a very useful tool!</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="600" height="543" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2021/06/sc.png" alt="" class="wp-image-31028" srcset="https://www.osradar.com/wp-content/uploads/2021/06/sc.png 600w, https://www.osradar.com/wp-content/uploads/2021/06/sc-300x272.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<h2>What are Scripts for?</h2>



<p>These elements can be used for multiple functions:</p>



<ul><li>Execution of a specific function for a web page.</li><li>Web development.</li><li>Adding a software plug-in</li><li>Schedule automatic tasks</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" width="595" height="709" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2021/06/sc2.png" alt="" class="wp-image-31029" srcset="https://www.osradar.com/wp-content/uploads/2021/06/sc2.png 595w, https://www.osradar.com/wp-content/uploads/2021/06/sc2-252x300.png 252w" sizes="(max-width: 595px) 100vw, 595px" /></figure>



<h2>How to enable PowerShell Script Execution in Windows 10</h2>



<p>Most likely, scripting in PowerShell is disabled by default. Therefore, it is necessary to make a procedure to run it. The first thing you need to do is to run PowerShell with administrator privileges. With this intention, press the Win+X combination and select the corresponding option:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="270" height="614" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2021/06/sc3.png" alt="Opening a PowerShell with administrator privileges" class="wp-image-31030" srcset="https://www.osradar.com/wp-content/uploads/2021/06/sc3.png 270w, https://www.osradar.com/wp-content/uploads/2021/06/sc3-132x300.png 132w" sizes="(max-width: 270px) 100vw, 270px" /><figcaption>Opening a PowerShell with administrator privileges</figcaption></figure>



<p>Then run the following command:</p>



<pre class="wp-block-preformatted">set-executionpolicy unrestricted –force</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="859" height="285" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2021/06/sc4.png" alt="How to enable script execution in PowerShell" class="wp-image-31032" srcset="https://www.osradar.com/wp-content/uploads/2021/06/sc4.png 859w, https://www.osradar.com/wp-content/uploads/2021/06/sc4-300x100.png 300w, https://www.osradar.com/wp-content/uploads/2021/06/sc4-768x255.png 768w, https://www.osradar.com/wp-content/uploads/2021/06/sc4-696x231.png 696w" sizes="(max-width: 859px) 100vw, 859px" /><figcaption>How to enable script execution in PowerShell</figcaption></figure>



<p>This action will enable the execution of <a href="https://www.osradar.com/category/windows/" target="_blank" rel="noreferrer noopener">PowerShell</a> scripts with the <em>unrestricted </em>policy.</p>



<h2>Script execution policy</h2>



<p>You can use other policies for script execution:</p>



<ul><li><em>Undefined</em> which performs the same function as <em>Unrestricted</em></li><li><em>Allsigned </em>which establishes that all scripts are signed.</li><li><em>ByPass </em>to avoid warnings</li><li><em>Restricted </em>disabling the execution of scripts</li><li><em>RemoteSigned </em>requires the signature of a trusted publisher when downloading scripts from the Internet.</li></ul>



<h2>The set-executionpolicy command</h2>



<p>This command modifies the PowerShell execution policy. It is also part of the security policies. Consequently, we can load configuration files. For example, the <a href="https://www.osradar.com/category/windows/" target="_blank" rel="noreferrer noopener">PowerShell </a>profile.</p>



<h2>Application scopes in PowerShell</h2>



<p>There are several areas of application of PowerShell. It is a local machine with scope for all users of the pc. Also <em>Current User </em>for the immediate user. Processes that affect only the current PowerShell session. Finally, there are group policy settings. For example, User Policy refers to the group policy for the current user. In addition, <em>MachinePolicy </em>with group policies for all users. For security reasons, it is necessary to verify the policy of each area. With this in mind, just run the following command:</p>



<pre class="wp-block-preformatted">Get-ExecutionPolicy –list </pre>



<p>Pressing Enter will display the selected information. Okay, so we have seen how to enable script execution in PowerShell. Bye!</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-enable-powershell-script-execution/">How to Enable PowerShell Script Execution</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-enable-powershell-script-execution/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write a Bash Script to Queue Links for youtube-dl</title>
		<link>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/</link>
					<comments>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/#comments</comments>
		
		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Sat, 07 Sep 2019 01:56:11 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[youtube-dl]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=13461</guid>

					<description><![CDATA[<p>Most people use YouTube. However, if you are like me and don’t like streaming your digital content and instead prefer to have raw media files available on your hard disk which can be played back at much better quality than streaming services offer on unstable or slow internet connections, then you are probably already using [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/">Write a Bash Script to Queue Links for youtube-dl</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most people use YouTube. However, if you are like me and don’t like streaming your digital content and instead prefer to have raw media files available on your hard disk which can be played back at much better quality than streaming services offer on unstable or slow internet connections, then you are probably already using the popular <a href="https://youtube-dl.org/"><strong>youtube-dl</strong></a> tool to download digital content from YouTube.</p>
<p>youtube-dl allows a user to download video and audio (or split the audio/video into separate files) from YouTube links by simply pasting the shared URL into the terminal console following the youtube-dl syntax. That’s the easy part. But what do you do if you have more than one or two links?</p>
<p>Sometimes when I am browsing YouTube I collect a bunch of links which I want to download. Sometimes this can be 3-5 links, or sometimes I can end up with an extensive list of 10 or more which I had not originally intended. It can be time consuming manually pasting in links then waiting for each download to complete before pasting in the next link and repeating the process. Thankfully, there is an easier way to do it by writing a neat little Bash script.</p>
<p>Let’s get started.</p>
<p>For example purposes, we will use the following fake randomly generated links to download:</p>
<pre><strong>https://youtu.be/ACcLsrbigWu</strong>
<strong>https://youtu.be/BAbg6BnkB3F</strong>
<strong>https://youtu.be/l0eRloaKxVS</strong></pre>
<p>So let’s write ourselves a neat little Bash script to deal with these links, using a combination of Bash and youtube-dl.</p>
<p>I use Emacs for this kind of short-style scripting, but feel free to use whatever code editor you prefer. Let’s just call our script something easy, like &#8220;yt-queue.sh&#8221;:</p>
<pre><strong>&gt; emacs yt-queue.sh</strong></pre>
<p>Then in your code editor, enter the following syntax:</p>
<pre><strong>#!/bin/bash</strong>
<strong>#</strong>

<strong>#start</strong>
<strong>#links</strong>
<strong>#end</strong></pre>
<p><img loading="lazy" class="aligncenter size-full wp-image-13465" src="https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1.png" alt="" width="1919" height="1079" srcset="https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1.png 1919w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-1068x601.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/yt-queue_1-747x420.png 747w" sizes="(max-width: 1919px) 100vw, 1919px" /></p>
<p>This provides a basic and sensible script layout for your youtube-dl queue.</p>
<p>Where we have &#8220;#links&#8221;, press &#8220;ENTER&#8221; at the end of the line so we get a new blank line. Now we need to paste in the links to download. But remember to write &#8220;youtube-dl&#8221; before each link. This is effectively telling the Bash script to use youtube-dl to download the link that follows. Once one link has completed downloading, the script then passes onto the next line in the queue, and then the next and so forth. Stupidly simple, yet effective.</p>
<p>After pasting in the links, the script should look something like this:</p>
<pre><strong>#!/bin/bash</strong>
<strong>#</strong>

<strong>#start</strong>
<strong>#links</strong>
<strong>youtube-dl https://youtu.be/ACcLsrbigWu</strong>
<strong>youtube-dl https://youtu.be/BAbg6BnkB3F</strong>
<strong>youtube-dl https://youtu.be/l0eRloaKxVS</strong>
<strong>#end</strong></pre>
<p>The script is finished. Now we need to just execute it when we are ready to start it.</p>
<p>This process is particularly useful for downloading extensive lists which can be done overnight &#8211; write your script before you go to bed, execute the script and by the morning your files will be completed.</p>
<p>Execute the script by simply running the following:</p>
<pre><strong>&gt; bash yt-queue.sh</strong></pre>
<p>You have now learned how to write a simple Bash script to queue links for youtube-dl.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/">Write a Bash Script to Queue Links for youtube-dl</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/write-a-bash-script-to-queue-links-for-youtube-dl/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
